Skip to content

Instantly share code, notes, and snippets.

@charltoons
Created March 29, 2017 15:57
Show Gist options
  • Save charltoons/1266a8ae0427ee286ecb83e1289ba233 to your computer and use it in GitHub Desktop.
Save charltoons/1266a8ae0427ee286ecb83e1289ba233 to your computer and use it in GitHub Desktop.
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=12,scale=768:-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 /tmp/gif.gif
gifsicle -O3 --no-extensions -o $2 --dither --colors 256 /tmp/gif.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment