Created
April 16, 2020 19:11
-
-
Save hernan43/94b607594dcd9da4740145651bf56572 to your computer and use it in GitHub Desktop.
Simple video file to GIF file using FFMPEG/ImageMagick script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
FFMPEG=/usr/local/bin/ffmpeg | |
CONVERT=/usr/local/bin/convert | |
if [ -z "$1" ] || [ -z "$2" ] | |
then | |
echo "Must specify an input video file and output gif file" | |
exit 1 | |
fi | |
$FFMPEG -i $1 -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | $CONVERT -delay 5 -loop 0 - gif:- | $CONVERT -layers Optimize - $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment