# gif-to-video: commands.log (2026-11-21, ffmpeg 6.1.1) test file: anim.gif (test pattern, 480x270, 10 fps, 2 s, loops forever) codec_name=gif width=480 height=270 pix_fmt=bgra color_transfer=unknown r_frame_rate=10/1 duration=2.000000 size=213463 edge file: once.gif codec_name=gif width=320 height=240 pix_fmt=bgra color_transfer=unknown r_frame_rate=10/1 duration=1.500000 size=57786 bytes 213463 ## 1. GIF to MP4 published: ffmpeg -i anim.gif -movflags +faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" anim.mp4 exit=0 time=.4474s codec_name=h264 width=480 height=270 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=10/1 duration=2.000000 size=69316 edge: a GIF set to play once (once.gif, 320x240, 1.5 s) published: ffmpeg -i once.gif -movflags +faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" once.mp4 exit=0 time=.2255s codec_name=h264 width=320 height=240 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=10/1 duration=1.500000 size=9185 ## 2. repeat the GIF five times so the video is long enough published: ffmpeg -stream_loop 4 -i anim.gif -movflags +faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" anim-x5.mp4 exit=0 time=.7866s codec_name=h264 width=480 height=270 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=10/1 duration=10.000000 size=335213 edge: the play-once GIF published: ffmpeg -stream_loop 4 -i once.gif -movflags +faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" once-x5.mp4 exit=0 time=.4618s codec_name=h264 width=320 height=240 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=10/1 duration=7.500000 size=31145 ## 3. upscale a small GIF to 1080 wide without blur (nearest neighbour) published: ffmpeg -stream_loop 4 -i anim.gif -movflags +faststart -pix_fmt yuv420p -vf "scale=1080:-2:flags=neighbor" anim-1080.mp4 exit=0 time=1.773s codec_name=h264 width=1080 height=608 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=10/1 duration=10.000000 size=1243301 edge: the play-once GIF published: ffmpeg -stream_loop 4 -i once.gif -movflags +faststart -pix_fmt yuv420p -vf "scale=1080:-2:flags=neighbor" once-1080.mp4 exit=0 time=1.285s codec_name=h264 width=1080 height=810 pix_fmt=yuv420p color_transfer=unknown r_frame_rate=10/1 duration=7.500000 size=81244 ## sizes 1243301 bytes anim-1080.mp4 335213 bytes anim-x5.mp4 213463 bytes anim.gif 69316 bytes anim.mp4 anim.mp4 is 32.5% of anim.gif (213463 -> 69316 bytes)