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
ffcast
withxrectsel
seems to require installation of xrectsel and adding onPATH
first, but then oddly manages to deletexrectsel
upon installation. Deletexrectsel
from your PATH statement in.bashrc
(it will be in{ffcast_DESTDIR}/usr/bin/
alongsideffcast
export PATH=$PATH:/home/louis/opt/FFcast/usr/bin
- Delete
git
source directories - Now that
ffcast
is 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 thePATH
for ease of use via. - Create a file in
/usr/local/bin/
named e.g.gifcast
(andchmod 755
it) :
#!/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
(seeman
pages)