GIF is a 1987 image format being used as a video format, and it shows. If you've converted a 5-second clip and got a 30 MB file, here's what's going on and which knobs actually matter.
1. GIF has no inter-frame video compression
MP4 (H.264) stores most frames as small differences from earlier frames. GIF stores each frame as its own LZW-compressed image (it can only skip unchanged pixels with transparency tricks). So size grows almost linearly with frames × pixels.
That gives you the two biggest levers:
- Width: size scales with area, so 960 px → 480 px is roughly 4× smaller.
- Frame rate: 30 fps → 12 fps is roughly 2.5× fewer frames. For UI demos and reactions 10–15 fps is fine.
2. 256 colours per frame
Each frame uses a palette of at most 256 colours. How you pick the palette matters:
- A generic palette makes skin tones and gradients band badly.
- A palette generated from the clip itself (ffmpeg's
palettegen+paletteuse) looks far better at the same size.
Example with ffmpeg:
ffmpeg -ss 2 -t 4 -i in.mp4 -vf "fps=12,scale=480:-1:flags=lanczos,split[a][b];[a]palettegen=stats_mode=diff[p];[b][p]paletteuse=dither=bayer:bayer_scale=3" out.gif 3. Dithering trades size for smoothness
Dithering scatters pixels to fake missing colours. It hides banding but adds noise, and noise compresses badly with LZW.
- Screen recordings / flat UI: fewer colours (64–128) and little or no dithering.
- Real camera footage: full 256 colours and ordered (bayer) dithering, which compresses better than error-diffusion.
4. Hitting a size limit
If a platform caps uploads, change one thing at a time in this order: trim → width → fps → colours → dithering. Re-check size after each step. If you still can't fit, a short muted MP4 is often 5–10× smaller and most sites autoplay it.
Disclosure: I run GoToolsOnline. Our free video-to-GIF tool does these steps in the browser UI: trim, width, fps, speed, loops, colour count, dithering, and an optional size limit (1–25 MB) where it re-makes the GIF and lists what it changed: https://gotoolsonline.com/tools/video-to-gif