I ran the recording commands in another terminal. Polished script for your
$PATH at the end of this answer.
FFcast helps the user interactively select a screen region and hands over the geometry to an external command, such as FFmpeg, for screen recording.
ffcast is the glorious product of some hacking at the Arch Linux community (mainly lolilolicon). You can find it on github (or in the AUR for Archers). Its dependency list is just
ffmpeg, though you'll want
xrectsel (AUR link) for interactive rectangle selection.
You can also append
ffmpeg flags right after the command. I set
-r 15 to capture at 15 frames per second and
-codec:v huffyuv for lossless recording. (Play with these to tweak the size/quality tradeoff.)
ImageMagick can read
.avi videos and has some GIF optimisation tricks that drastically reduce file size while preserving quality: The
-layers Optimize to
convert invokes the general-purpose optimiser. The ImageMagick manual has a page on advanced optimisations too.
This is what I have in my
$PATH. It records into a temporary file before converting.
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
(Thanks to BenC for detective work in figuring out the correct command after the recent