High quality GIF with FFmpeg
Created on 2022-10-03T21:56:55-05:00
- Use palettegen to create a color palette suitable for use across the entire video
- Use paletteuse to convert frames of animation back to the palette
#!/bin/sh palette="/tmp/palette.png" filters="fps=15,scale=320:-1:flags=lanczos" ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2