ffmpeg -i input.mp4 -i palette.png -lavfi "fps=15,scale=480:-1[x];[x][1:v]paletteuse" output.gif

Category: Media & Conversion

ffmpeg -i input.mp4 -i palette.png -lavfi "fps=15,scale=480:-1[x];[x][1:v]paletteuse" output.gif

Apply a palette to make a high-quality GIF

Second step of the palette GIF recipe: uses palette.png from palettegen and the -lavfi filter graph to map frames at 15 fps onto the 256-color palette. '[x][1:v]paletteuse' connects the scaled video to the palette image. The result looks far better than a plain fps/scale GIF.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.