Using Animated images in Remotion
Basic usage
Use<AnimatedImage> to display a GIF, APNG, AVIF or WebP image synchronized with Remotion’s timeline:
Sizing and fit
Control how the image fills its container with thefit prop:
Playback speed
UseplaybackRate to control the animation speed:
Looping behavior
Control what happens when the animation finishes:Styling
Use thestyle prop for additional CSS (use width and height props for sizing):
Getting GIF duration
UsegetGifDurationInSeconds() from @remotion/gif to get the duration of a GIF.
Alternative
If<AnimatedImage> does not work (only supported in Chrome and Firefox), you can use <Gif> from @remotion/gif instead.
<Gif> component has the same props as <AnimatedImage> but only supports GIF files.