Skip to content

Instantly share code, notes, and snippets.

@waruqi
Created January 17, 2017 13:59
Show Gist options
  • Save waruqi/ae0ad327ca9a4b89657e96e6bd200929 to your computer and use it in GitHub Desktop.
Save waruqi/ae0ad327ca9a4b89657e96e6bd200929 to your computer and use it in GitHub Desktop.
mov2gif
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=$4,scale=$3:-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
@waruqi
Copy link
Author

waruqi commented Jan 17, 2017

./mov2gif ./xxx.mov xxx.gif 800 1
convert xxx.gif -fuzz 5% -layers Optimize xxx2.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment