Recording a screencast on Linux

TIL I can record a screencast using GNOME’s tool, trim it with ffmpeg like this:

cd ~/Screencasts
ffmpeg -i screencast.webm -ss 00:00:03.120 -t 00:00:11.500 output.webm

then resize with ImageMagick:

magick output.webm -resize 50% -layers coalesce output.webp

and simply use webp as is instead of converting it to gif, as browser support for webp is pretty decent nowadays.