Skip to content

Instantly share code, notes, and snippets.

@gorillamoe
Created November 17, 2017 16:30
Show Gist options
  • Save gorillamoe/50c4d45c12a3db7e2fda049250d15b08 to your computer and use it in GitHub Desktop.
Save gorillamoe/50c4d45c12a3db7e2fda049250d15b08 to your computer and use it in GitHub Desktop.
Convert webm movies to GIF
#!/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