Created
March 21, 2016 21:34
-
-
Save rtyler/c8e19d03e6c9b67827d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -xe | |
OUTPUT_AVI=gifcast.avi | |
OUTPUT_DIR=/tmp/gifcast | |
ORIG_DIR=${PWD} | |
RESULT_GIF=${PWD}/gifcast-`date "+%Y%m%d-%H%M"`.gif | |
rm -rf ${OUTPUT_DIR} | |
mkdir ${OUTPUT_DIR} | |
ffmpeg -f x11grab -r 10 -s 1024x768 -i :0.0 -vcodec huffyuv ${OUTPUT_DIR}/${OUTPUT_AVI} | |
mplayer -ao null ${OUTPUT_DIR}/${OUTPUT_AVI} -vo jpeg:outdir=${OUTPUT_DIR} | |
cd ${OUTPUT_DIR} | |
convert *.jpg gifcast.gif && convert gifcast.gif -fuzz 10% -layers Optimize ${RESULT_GIF} | |
echo "Created ${RESULT_GIF}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment