Created
November 17, 2017 16:30
-
-
Save gorillamoe/50c4d45c12a3db7e2fda049250d15b08 to your computer and use it in GitHub Desktop.
Convert webm movies to GIF
This file contains 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
#!/bin/bash | |
main() { | |
if [[ -z $1 ]]; | |
then | |
printf "Input file required\n" | |
exit 1 | |
else | |
local inputfile="$1" | |
fi | |
if [[ -z $2 ]]; | |
then | |
printf "Output file required\n" | |
exit 1 | |
else | |
local outputfile="$2" | |
fi | |
ffmpeg -i "$inputfile" -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - gif:- | convert -layers Optimize - "$outputfile" | |
} | |
main "$@" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment