Skip to content

Instantly share code, notes, and snippets.

@alfredodeza
Created March 16, 2016 11:40
Show Gist options
  • Save alfredodeza/a3faa3b4601257f9bd0a to your computer and use it in GitHub Desktop.
Save alfredodeza/a3faa3b4601257f9bd0a to your computer and use it in GitHub Desktop.
convert an mp4 to a gif
mp4=$1
DEFAULT_GIF_NAME="output.gif"
OUTPUT=${2:-$DEFAULT_GIF_NAME}
# -delay is used to control the timing between frames, the scale sets the resolution
ffmpeg -i $mp4 -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 10 -loop 0 - $OUTPUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment