Bash script: screencast GIF (via temp .avi) - lmmx/devnotes GitHub Wiki
mkdir /home/louis/opt/FFcast
chmod 777 /home/louis/opt/FFcast
cd FFcast && ./bootstrap && ./configure --enable-xrectsel --prefix /usr --libexecdir /usr/lib --sysconfdir /etc && make && make DESTDIR="/home/louis/opt/FFcast" install
chmod 755 /home/louis/opt/FFcast
If unable to located package autoreconf install dh-autoreconf
sudo apt-get install dh-autoreconf
./bootstrap && ./configure --enable-xrectsel --prefix /usr --libexecdir /usr/lib --sysconfdir /etc && make && make DESTDIR="/home/louis/opt/FFcast" install
- Installing
ffcastwithxrectselseems to require installation of xrectsel and adding onPATHfirst, but then oddly manages to deletexrectselupon installation. Deletexrectselfrom your PATH statement in.bashrc(it will be in{ffcast_DESTDIR}/usr/bin/alongsideffcast
export PATH=$PATH:/home/louis/opt/FFcast/usr/bin
- Delete
gitsource directories - Now that
ffcastis a command, it can be used in a bash script to make a screencast (GIF via temporary avi video file), and this script can also be put onto thePATHfor ease of use via. - Create a file in
/usr/local/bin/named e.g.gifcast(andchmod 755it) :
#!/bin/bash
TMP_AVI=$(mktemp /tmp/outXXXXXXXXXX.avi)
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 out.gif
gifcast is now a command to create out.gif from the screen in whichever directory you're running in :smiley:
- Note: if the script errors out with
error: external command '%' not found, try removing the%in the script after-s(seemanpages)