GIF vs MP4: why most GIFs online are really videos
A SaveContentMe guide · Updated
How a GIF works
GIF dates from the late 1980s and was built for simple graphics. Every pixel is an index into a palette of at most 256 colours. That's too few for photos and video: smooth gradients turn into steps, which are disguised with a pattern of dots called dithering. Its LZW compression is lossless, but it suits drawings with flat areas, not camera footage.
A GIF animation is a sequence of images, where each new frame may update only the part that changed. The format can't predict motion the way video codecs do, and it has no sound at all. That's why even a short piece of real video takes up a lot of space as a GIF: each frame is stored almost as a separate picture.
Why MP4 is so much smaller
H.264 describes each frame by how it differs from its neighbours: what moved and where. On top of that it uses lossy compression the eye barely notices. In web.dev's example, a 3.7 MB GIF became a 551 KB MP4 and a 341 KB WebM, roughly 6.7 and almost 11 times smaller, and the colours were no longer limited to a 256-shade palette.
You can sanity-check the scale yourself. A 480 × 270 frame has 129,600 pixels, about 130 KB at one byte per pixel before compression. Five seconds at 15 fps is 75 frames, or roughly 9.7 MB for LZW to squeeze. It does poorly on camera footage, while a video codec fits the same clip into a few hundred kilobytes.
So platforms serve video
Many platforms call short looping clips GIFs but store and play them as silent video. X keeps GIFs as short clips, which is why SaveContentMe saves them as MP4. Telegram's documentation defines an animation as a GIF or an H.264/MPEG-4 AVC video without sound, and in a chat it loops just like the GIFs you're used to.
For you that's mostly good news: an MP4 opens in any gallery or editor, takes less space and keeps more colour. The catch is that a phone gallery treats it as an ordinary short video and won't loop it on its own. And some places, like older forums or email signatures, still accept only GIF in place of video.
When you really need a GIF
GIF still has its niches: places that won't take video, and simple graphics with a transparent background, which H.264 can't do at all. For websites, MDN suggests considering animated WebP, AVIF or APNG instead, and web.dev recommends a short video with the autoplay, loop, muted and playsinline attributes, which behaves just like a GIF.
If you do need a GIF of your own clip, keep it short: 3 to 5 seconds, 10 to 15 fps, around 480 pixels wide. In FFmpeg, generating a palette for that specific clip gives much better colour: ffmpeg -i clip.mp4 -vf "fps=12,scale=480:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse" clip.gif. The result looks closer to the source than with a generic palette.
Going the other way, from a GIF to a compact video, web.dev's recipe is: ffmpeg -i animation.gif -b:v 0 -crf 25 -f mp4 -vcodec libx264 -pix_fmt yuv420p animation.mp4. If the GIF's width or height is an odd number, you'll also need a crop filter to even dimensions, which the same article provides.