Skip to content

Instantly share code, notes, and snippets.

@bwhiteley
Created December 12, 2017 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwhiteley/a997201e608dacc06f3827e0748a4d53 to your computer and use it in GitHub Desktop.
Save bwhiteley/a997201e608dacc06f3827e0748a4d53 to your computer and use it in GitHub Desktop.
Create GIF from screen recording (or other video)
#!/bin/sh
# https://superuser.com/questions/436056/how-can-i-get-ffmpeg-to-convert-a-mov-to-a-gif
# Requires ffmpeg and ImageMagick
INPUT=$1
OUTPUT=$2
TMP=giffer_tmp_$$.gif
if [ "x$OUTPUT" == "x" ]; then
echo "Invalid args"
exit 1
fi
ffmpeg -i $INPUT -pix_fmt rgb24 -r 10 $TMP
convert -layers Optimize $TMP $OUTPUT
rm $TMP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment