Cool S#!t in Linux: Screen Recording to a gif
In my previous Cool S#!t in Linux post, I showed a recording of my terminal running the mentioned script and program. Just making that gif is a pretty cool skill, so I figured I'd explain how I did that with a bonus post.
What I did was
sudo apt-get install byzanz. To figure out which arguments were necessary, I used
byzanz-record --help, which provides the following options:
crow@TDalton:~$ byzanz-record --help Usage: byzanz-record [OPTION...] record your current desktop session Help Options: -?, --help Show help options --help-all Show all help options --help-gtk Show GTK+ Options Application Options: -d, --duration=SECS Duration of animation (default: 10 seconds) -e, --exec=COMMAND Command to execute and time --delay=SECS Delay before start (default: 1 second) -c, --cursor Record mouse cursor -a, --audio Record audio -x, --x=PIXEL X coordinate of rectangle to record -y, --y=PIXEL Y coordinate of rectangle to record -w, --width=PIXEL Width of recording rectangle -h, --height=PIXEL Height of recording rectangle -v, --verbose Be verbose --display=DISPLAY X display to use
Unfortunately, I have to do a bit of Kentucky aiming to get on target:
byzanz-record -x 0 -y 25 -w 100 -h 100 -d 1 ./file.gif
byzanz-record -x 0 -y 25 -w 110 -h 110 -d 1 ./file.gif
byzanz-record -x 0 -y 25 -w 200 -h 200 -d 1 ./file.gif
byzanz-record -x 0 -y 25 -w 180 -h 180 -d 1 ./file.gif
I'm sure there's a tool to make this much easier but I didn't feel like looking right now. I'll update this in the future with my findings.
These commands made a 1 second gif at
/home/crow/file.gif, so I pointed my web browser there- file:///home/crow/file.gif- and refreshed on each gif creation to get a look at where I was hitting.
Once I hit the area I was looking for, it was showtime. A more invested gif maker would find something to edit the length after recording or increase the quality or add titles to it, but this took two minutes to find and effectively use. I'm erring on the side of convenience.