Originally published at ffmpeg-micro.com . Converting an MP4 to a GIF with FFmpeg sounds simple until you actually try it. The default output is either a blurry mess or a 50MB file that nobody wants to load. The trick is knowing which FFmpeg flags control quality and file size independently. The Basic Command (and Why It Looks Bad) The most basic FFmpeg conversion looks like this: ffmpeg -i input.mp4 output.gif Enter fullscreen mode Exit fullscreen mode This technically works. But the result will look terrible. GIFs are limited to 256 colors per frame. FFmpeg's default color selection doesn't pick the right 256 to keep, so you get banding, dithering artifacts, and washed-out colors. The file will also be massive because there's no compression optimization happening. A 10-second 1080p clip can easily produce a 100MB+ GIF. High-Quality GIFs with Palette Generation The fix is FFmpeg's palettegen and paletteuse filters.…