Skip to content

Instantly share code, notes, and snippets.

@andrewk
Created August 8, 2014 01:23
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 andrewk/8417cdb175c182a0430f to your computer and use it in GitHub Desktop.
Save andrewk/8417cdb175c182a0430f to your computer and use it in GitHub Desktop.
Animated screenshot for github PRs
#!/bin/sh
# Convert movie (screencast) to lofi animated gif for embedding in github PR's, emails etc.
#
# Requires: ffmpeg, gifsicle
# Screencasts are easily captured in Quicktime Player: File > New screen recording
if [ -z "$1" ]
then
echo "Usage: mov2gif input.mov 700 > output.gif"
echo "Second argument is gif max width in pixels, defaults to 600"
exit 1
fi
ffmpeg -i $1 -vf scale=${2:-600}:-1 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment