Skip to content

Instantly share code, notes, and snippets.

@tcgriffith tcgriffith/scr2gif.sh
Last active Oct 20, 2017

Embed
What would you like to do?
#!/bin/bash
# http://tc.rbind.io/post/2017/10/20/create-a-gif-screencast-a-bash-script/
# require slop, ffmpeg, imageMagick
read -r X Y W H G ID < <(slop -f "%x %y %w %h %g %i")
TMP_AVI=$(mktemp /tmp/outXXXXXXXXXX.avi)
ffmpeg -s "$W"x"$H" -y -f x11grab -i :0.0+$X,$Y -vcodec huffyuv -r 25 $TMP_AVI \
&& convert -set delay 5 -layers Optimize $TMP_AVI ./out.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.