Skip to content

Instantly share code, notes, and snippets.

@tcgriffith
Last active October 20, 2017 06:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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