Skip to content

Instantly share code, notes, and snippets.

@joannecheng
Created April 3, 2019 08:17
Show Gist options
  • Save joannecheng/34fdc6df14e118741b25f689a3e42cac to your computer and use it in GitHub Desktop.
Save joannecheng/34fdc6df14e118741b25f689a3e42cac to your computer and use it in GitHub Desktop.
Movie to GIF using ffmpeg
if [ $# -eq 0 ] ; then
echo "example use: 'movie-to-gif.sh [movie-file]'"
exit 0
fi
ffmpeg -i $1 -filter_complex "[0:v] palettegen" $1-palette.png
ffmpeg -i $1 -i $1-palette.png -filter_complex "[0:v][1:v] paletteuse" $1.gif
rm $1-palette.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment