Browser FFmpeg recipe
Convert GIF to MP4 Online with FFmpeg
Create a web-friendly MP4 from an animated GIF.
Command
Run this FFmpeg command
ffmpeg -i input.gif -movflags +faststart -pix_fmt yuv420p -vf scale=trunc(iw/2)*2:trunc(ih/2)*2 output.mp4When to use it
- smaller animations
- web uploads
- social previews
How it works
- Upload the animated GIF.
- Run the MP4 conversion command.
- Download the converted MP4.
Option reference
| Option | What it does |
|---|---|
-pix_fmt yuv420p | Improves playback compatibility. |
scale=trunc(iw/2)*2:trunc(ih/2)*2 | Ensures even video dimensions. |
-movflags +faststart | Optimizes MP4 playback start. |
Practical notes
- MP4 is usually much smaller than GIF for animation.
- GIFs do not contain normal audio, so the output is silent.
FAQ
Why convert GIF to MP4?
MP4 usually compresses animation better and plays more smoothly on the web.
Can I keep transparency?
This MP4 preset does not preserve alpha transparency.