Skip to content

Instantly share code, notes, and snippets.

@crates
Forked from kdzwinel/mkgif.sh
Created February 11, 2020 17:34
Show Gist options
  • Select an option

  • Save crates/992b71fc8eb769496d50f4efbafaa0a6 to your computer and use it in GitHub Desktop.

Select an option

Save crates/992b71fc8eb769496d50f4efbafaa0a6 to your computer and use it in GitHub Desktop.
Making gifs from mov files on OS X.
#!/bin/sh
palette="./palette.png"
# speed - setpts=0.15*PTS,
# crop - ffmpeg -i in.mov -filter:v "crop=480:600:320:80" out.mov
filters="fps=25,scale=640:-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 $1.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment