← back
I've recently been enjoying slack emojis (especially the animated ones), but taking a video and getting it to be a Gif that will be under 50 frames total and ~128Kb has proved to be... a pain...
ffmpeg -ss 4 -to 7 -i Video-930.mp4 \
    -vf "crop=in_w:in_w:0:150,fps=10,scale=128:128:flags=lanczos,palettegen=max_colors=12" \
    -y sea-lion-escape-palette.png

ffmpeg -ss 4 -to 7 -i Video-930.mp4 -i sea-lion-escape-palette.png \
    -filter_complex "[0:v]crop=in_w:in_w:0:150,fps=10,scale=128:128:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=5" \
    -y sea-lion-escape.gif
luckily everyones favourite tool ffmpeg can run in the brwoser though (ty wasm)