Skip to content

Instantly share code, notes, and snippets.

@madx
Last active September 29, 2015 06:54
Show Gist options
  • Save madx/513926799c370f977531 to your computer and use it in GitHub Desktop.
Save madx/513926799c370f977531 to your computer and use it in GitHub Desktop.
Quick GIF screencasts using bash + ffcast + ffmpeg + imagemagick + yad
#!/bin/bash
FILE="$HOME/Images/Captures/`date +%FT%T.gif`"
TMP_AVI=$(mktemp /tmp/outXXXXXXXXXX.avi)
(yad --notification --image media-playback-stop --command "bash -c 'echo q; quit'") |\
ffcast -s % ffmpeg -y -f x11grab -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 $FILE
rm $TMP_AVI
echo "$FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment