Flickering when using Next.js <Image> tag
The following code is discouraged in Remotion:
❌ Don't do thistsx
import Image from "next/image";const myMarkup = <Image src="https://picsum.photos/200/300"></Image>;
❌ Don't do thistsx
import Image from "next/image";const myMarkup = <Image src="https://picsum.photos/200/300"></Image>;
Problem
Remotion has no way of knowing when the image is finished loading because it is impossible to determine so when loading an image through <Image>
.
This will lead to Remotion not waiting for the image to be loaded during rendering and cause visible flickers.
Solution
Use the <Img>
tag instead:
✅ Do thistsx
import {AbsoluteFill ,Img } from "remotion";constmyMarkup = <Img src ="https://picsum.photos/200/300" />;
✅ Do thistsx
import {AbsoluteFill ,Img } from "remotion";constmyMarkup = <Img src ="https://picsum.photos/200/300" />;