Convert, loop, enlarge

Post an animated GIF as a video

Updated Commands run November 21, 2026Test pattern GIFsffmpeg 6.1.1

A looping film reel with an arrow pointing to a video player and a row of repeated frames.

Short answer

Most video platforms do not take a GIF as a video upload, so convert it to MP4 first. One ffmpeg command does it, and the result is smaller: our 2 second test GIF went from 213 KB to 69 KB. Two things usually need fixing afterwards. A GIF is short, so repeat it until the video is long enough to post. And a GIF is small, so enlarge it with a filter that keeps hard pixel edges instead of blurring them. Both commands are below, or use the free Koldflux GIF to MP4 converter.

GIF to MP4 converter

Key takeaways

  • GIF to MP4 in one line. Our test GIF became a file 32.5% of its size at the same dimensions and length.
  • Repeat it: -stream_loop 4 plays the GIF five times, turning 2 seconds into 10.
  • Enlarge with flags=neighbor to keep pixel edges crisp; a 480 x 270 GIF came out at 1080 x 608.
  • A GIF saved to play only once converted and looped the same way as one that loops forever.
  • X is the exception: it accepts animated GIFs directly. YouTube, TikTok's upload API and Pinterest list video files, not GIF.

Why uploading the GIF fails

On most video surfaces your GIF is simply not on the list of accepted files. The Koldflux format pages keep a record per platform, each tied to the platform's own documentation.

GIF as a video upload, by platform
PlatformStatus on our format pageWhat to do
YouTube and ShortsNo: not on YouTube's supported formats listConvert to MP4
TikTokNo for the Content Posting API, which lists MP4, MOV and WebMConvert to MP4
PinterestNo: not in the current Pin upload specificationsConvert to MP4
Instagram Reels and feedNot re-verifiedConvert to MP4 to be safe
Facebook ReelsNot re-verifiedConvert to MP4 to be safe
XYes: animated GIF attachments, up to 5 MB on mobile or 15 MB on webUpload the GIF, or a video if it is larger

Each row links to its source on the format page for that platform, where you can read the platform's own wording, see the date it was last checked and decide for yourself how much weight to put on a status that is anything other than a plain yes or no. "Not re-verified" means the platform's current list could not be confirmed when the record was last reviewed, which is not the same as no.

Free tools:Does YouTube Shorts support GIF?Does X support GIF?

Convert it

Three options in your command do the work. The pixel format makes the file playable everywhere. The scale step rounds the width and height down to even numbers, which the H.264 encoder requires and many GIFs do not have. And faststart puts the index at the front so the video starts playing before it has fully loaded.

ffmpeg -i anim.gif -movflags +faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" anim.mp4
Exit 0. A 480 x 270, 2 second GIF of 213,463 bytes became an MP4 of 69,316 bytes.

No command line? The Koldflux GIF to MP4 converter runs in your browser and uploads nothing.

Free tool:GIF to MP4 converter

Is a two-second video long enough?

Rarely. A GIF loops forever in a browser, but a video plays once and stops, and a clip of a second or two is over before anyone scrolling past your post has even registered that something was moving, let alone what it was. Some platforms also set a minimum length. Pinterest, for one, gives 4 seconds as the minimum for a video Pin. Repeat the GIF inside the file:

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
The number is extra plays: 4 means five in total. Exit 0; 2 seconds became 10, in 335,213 bytes.

We also tried a GIF saved to play once only, 1.5 seconds long. It converted to a 1.5 second video and looped to 7.5 seconds with the same two commands. The play-once setting inside a GIF does not carry over to the video and does not get in the way.

How do you make a small GIF fill the screen?

Scale it up, and choose how. The default scaling smooths the picture, which turns pixel art, screen captures and text into mush. The neighbor setting repeats each pixel instead, so edges stay hard.

ffmpeg -stream_loop 4 -i anim.gif -movflags +faststart -pix_fmt yuv420p -vf "scale=1080:-2:flags=neighbor" anim-1080.mp4
Width 1080, height kept in proportion and even. Exit 0; 480 x 270 became 1080 x 608.

For a GIF made from a photo or video, leave flags=neighbor out; smooth scaling suits those better. Either way, enlarging adds no detail to your picture. And the file grows: our enlarged version is 1.24 MB against 0.34 MB at the original size.

Most GIFs are wide or square, and the apps you are converting for are tall. To put your result in a vertical frame, pad it or add a blurred fill as the landscape to vertical guide shows, and do the enlarging there in one pass, so the picture is scaled once instead of twice.

What is lost and what is gained?

  • Gained: a much smaller file at the same size, acceptance on video platforms, and sound if you add a track afterwards.
  • Lost: transparency. If your GIF has a see-through background, the MP4 gets a solid one.
  • Lost: endless looping as a property of the file. Whether a short video repeats is up to the app that plays it.
  • Unchanged: the picture quality. A GIF has at most 256 colors and the video keeps what was there.

Free tool:Add audio to a video

Limits of these tests

Both GIFs are generated test patterns, so the size figures describe them and nothing else; a photographic GIF or a flat cartoon will compress differently. Platform statuses are copied from our format pages and carry their own review dates. Nothing was uploaded to any platform.

Do it in your browser

Free Koldflux tools, no account needed.

GIF to MP4 converterVideo to GIF converter

Questions people ask

How do I convert a GIF to MP4?

With ffmpeg: set the pixel format to yuv420p, round the size to even numbers and write an .mp4 file. Or use the Koldflux GIF to MP4 converter in the browser.

Can I upload a GIF to Instagram or TikTok?

Not reliably as a video. TikTok's upload API lists MP4, MOV and WebM, and Instagram's current list was not re-verified. Convert to MP4.

How do I make the video longer than the GIF?

Loop the input with -stream_loop. A value of 4 plays the GIF five times.

Why does ffmpeg fail with "width not divisible by 2"?

The GIF has an odd width or height and H.264 needs even numbers. The scale step in the command on this page fixes it.

Will the MP4 be smaller than the GIF?

Usually much smaller. Ours was 32.5% of the GIF's size. The exact saving depends on the picture.

Related

More guides on this topic

Sources and how we checked

  1. commands.log: conversion, looping and upscaling with exit codes, sizes and a play-once GIF edge input (our run, November 21, 2026) (checked 2026-11-21)
  2. make-tests.sh: builds the test GIFs and runs the commands (Koldflux, shell) (checked 2026-11-21)
  3. YouTube Help: supported upload file formats (GIF is not listed) (checked 2026-11-21)
  4. Pinterest Help: Review Pin specs (video Pin minimum 4 seconds) (checked 2026-11-21)
  5. Koldflux format pages: GIF status per platform with each platform source (checked 2026-11-21)
  6. Koldflux test log showing the odd-size encoder error and the scale fix on a still image (voice memo guide, November 21, 2026) (checked 2026-11-21)
  7. FFmpeg documentation: -stream_loop and the scale filter (checked 2026-11-21)

On November 21, 2026 we generated two test GIFs, converted, looped and enlarged them with ffmpeg 6.1.1 and recorded exit codes, dimensions, lengths and byte sizes. Platform statuses were read from the Koldflux format pages the same day.