Skip to content

Instantly share code, notes, and snippets.

@gregtatum
Created April 23, 2015 21:07
Show Gist options
  • Select an option

  • Save gregtatum/d6c2de6e60fea71c8bf5 to your computer and use it in GitHub Desktop.

Select an option

Save gregtatum/d6c2de6e60fea71c8bf5 to your computer and use it in GitHub Desktop.
gif.sh
#Run: gif.sh file.mov 320
#Outputs a file.gif at 320px wide
OUT=$(echo $1 | sed -e 's/\.[a-zA-Z0-9]*$/.gif/')
ffmpeg -i "$1" -vf scale=${2:-640}:-1 -r 30 -f image2pipe -vcodec ppm - | convert -delay 5 -layers Optimize -loop 0 - "$OUT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment