Skip to content

Instantly share code, notes, and snippets.

@paldepind
Created March 17, 2016 12:32
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 paldepind/182e2959eae785b6a7d8 to your computer and use it in GitHub Desktop.
Save paldepind/182e2959eae785b6a7d8 to your computer and use it in GitHub Desktop.
Record a selected window to a gif file. Remove `-draw_mouse 0` if you want the cursor included.
#!/bin/bash
TMP_AVI=$(mktemp /tmp/outXXXXXXXXXX.avi)
ffcast -w % ffmpeg -y -f x11grab -draw_mouse 0 -show_region 1 -framerate 15 \
-video_size %s -i %D+%c -codec:v huffyuv \
-vf crop="iw-mod(iw\\,2):ih-mod(ih\\,2)" $TMP_AVI \
&& convert -set delay 10 -layers Optimize $TMP_AVI out.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment