input.gif
Selected file
FFmpeg command
ffmpeg -i 'input.gif' -an -vf 'scale=trunc(iw/2)*2:trunc(ih/2)*2,format=yuv420p' -c:v libx264 -fps_mode vfr -movflags +faststart 'output.mp4'GIF → MP4
Encode the GIF animation as an H.264 video. The animation plays once, has no audio, and does not retain transparency.
-anDisable audio; GIF files do not contain an audio track.
-c:v libx264Encode the video using the widely supported H.264 codec.
-pix_fmt yuv420pUse a pixel format supported by most MP4 players. Odd dimensions are rounded down to even values.
-fps_mode vfrPreserve the GIF's frame timing in the output video.