You have the perfect five seconds of video and you need it as a GIF: a reaction for a chat, a looping demo for a README, an animation for a forum signature. The good news is that every modern tool can do this. The better news is that most of them do it badly, producing files that weigh more than the original video.
Here is how to convert video to GIF properly, from one-click tools to the method professionals use.
The quick options
Online converters
Dozens of sites accept a video file or even a platform URL and return a GIF. They work in a pinch. Two things to watch: upload limits on free tiers, and privacy, since you are handing your file to a third-party server. Fine for memes, questionable for unreleased product footage.
Built into chat apps
Some messengers convert short videos into looping "GIFs" automatically when you mark them as such. Convenient, but the result lives inside that platform. Use it when the destination is that chat anyway.
FFmpeg: the method that actually works
For anything you will embed in a page, documentation, or email, FFmpeg gives you full control and the smallest files. The two-step approach produces dramatically better results than a single command:
Step 1: extract a palette first
GIFs are limited to 256 colors. Naive conversion picks a generic palette and produces banding, those ugly staircase gradients in skies and skin tones. Generate a palette tailored to your clip instead:
ffmpeg -i clip.mp4 -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" palette.png
Step 2: use the palette in the conversion
ffmpeg -i clip.mp4 -i palette.png -lavfi "fps=12,scale=480:-1:flags=lanczos [x]; [x][1:v] paletteuse" output.gif
The result: same clip, same colors, typically half the file size of a naive export.
The three dials that matter
Frame rate
12 fps is the sweet spot for most reactions. 15 fps for smooth motion. Going above 15 for a GIF is almost always wasted bytes.
Width
480 pixels covers most embed situations; 360 is plenty for chat reactions; go 640 only when fine detail genuinely matters. Every doubling of width roughly quadruples file size.
Duration
GIFs belong in the two to six second range. Past ten seconds, you should seriously consider a looping video file instead.
When you should not make a GIF at all
If the GIF is destined for your own website, documentation, or anywhere you control the markup, a muted looping MP4 or WebM is the better format: roughly a quarter of the size at visibly better quality, and browsers autoplay it exactly like a GIF with the right attributes. Upload the clip to a video-capable host like s.pub, or serve it yourself, and use a video tag with autoplay, muted, loop, and playsinline. Save true GIF format for the places that only accept images.
Testing before you ship
Check the loop point: cut on similar frames so the restart is invisible. Check the file size: anything over 8 MB will feel heavy on the page it lands on. And view it once at actual destination size, because downscaled GIFs hide artifacts that full-size viewing exposes.
Summary
For quick one-off reactions, an online converter is fine. For anything embedded or reused, run the FFmpeg two-step with a generated palette, keep it under six seconds, and strongly consider a looping video file instead. Your page load times, and everyone on metered mobile data, will thank you.
No comments yet