Convert GIF to MP4 with FFmpeg (Smaller and Smoother)

Turn an animated GIF into an H.264 MP4 that is far smaller and plays on every device.

WindowsffmpegconvertgifLow risk
Run ffmpeg -i animation.gif -movflags +faststart -pix_fmt yuv420p animation.mp4.

01Command

Command
$ ffmpeg -i animation.gif -movflags +faststart -pix_fmt yuv420p animation.mp4

02What it does

GIF is an ancient format: huge files, 256 colors, no sound. Re-encoding to H.264 MP4 typically shrinks the file by 80–90% with smoother motion. -pix_fmt yuv420p keeps it compatible with Windows players, phones and social apps, while +faststart moves the index to the file head so it starts playing instantly online.

03Risk

RiskLow risk
RequirementsFFmpeg is not preinstalled on Windows — install it first with: winget install --id Gyan.FFmpeg
!Warning: If the output shows green or gray edges, the GIF width/height wasn't divisible by 2 — add a crop or scale filter, e.g. -vf crop=trunc(iw/2)*2:trunc(ih/2)*2.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-18 · Category: Media