Automating Everything, Including Technical Demos

I recently pushed myself to create a presentation about a deep dive into the Linux Boot Process and a non-standard Ubuntu installation technique I tend to use. I was interested in sharing the experiment but also I wanted to know what making these kinds of videos was like.

Along the way, I made some tooling, I used some tooling, and I learnt a lot about how to do this better next time. Here I capture those ideas while they're still fresh.

Smooth Typing

Right from the start, I decided that I wanted smooth typing. I wanted more personality than just screengrabs of commands. I also wanted to respect my viewers time by ensuring typing accuracy. As fast and as good as my typing is, I hit backspace a lot.

So, in the interest of automating everything, I wrote a python script called send_keys.py which reads stdin character-by-character, converts each character to a keystroke, and sends the keystroke via virsh send-keys. I added in a randomized delay between characters and a randomized hold time and the result is a fast, but passable typing of commands in my VM of choice.

This worked really well. With some automated startup and teardown scripts, I could nullify the VM and recreate it, then send "snippets" using this auto-typer.

Automating The Installation

What I came up with was this:

presentation
  |- 0000-Intro-and-setup
    |- 0000-prompt-intro.md
    |- 0001-exec-enter-for-just-try-it.sh
    |- 0100-prompt-open-terminal.md
    |- 0101-exec-open-terminal-and-maximize-it.sh
    |- 0102-snippet-auto-1-sudo-to-root-terminal.sh
    |- 0104-snippet-auto-1-install-tmux.sh
  |- 0001-Partitioning
    |- ...
send_keys.py
present.py

Folders become "sections", and files are steps in each section. The folders and files are all prefixed with a priority number. The files then have a type which is prompt, exec, or snippet. The prompts were meant to be a teleprompter but I found that voicing over worked better and so they weren't used. They were simply displayed. The scripts with -exec- were run on the host to send special keys like CTRL+ALT+T. Finally, the heart of this was the snippets which were sections of typing to be sent using send_keys.py to the VM.

My present.py became responsible for running each step defaulting to "enter to continue" to progress. I quickly became tired of that and added an optional '-auto-' to the filenames. When present, it indicates how many seconds present.py should wait before executing that step. This allowed me to essentially automate all of the steps except for apt installs.

This worked really well, and I was able to automate the installation and record with OBS.

Recording with OBS

I recorded the VM with OBS. Unfortunately there is a bug with the Ubuntu Installer running with spice where sometimes X11 starts, but doesn't display anything but the X cursor. The installer ran because the starting chime still showed up. I did NOT solve this, instead I just kept retrying until I won the race condition.

OBS was great for capturing. I originally did full-length captures but I quickly learnt that OBS has a websockets api and a python library for accessing it. This allowed me to modify present.py so that OBS would stop the recording, change the filename, then start recording at the start of each snippet. For video editing, this meant that my files become the natural cut points and I didn't need to seek them out. This was a big improvement over manually seeking, and manually slicing a single long video.

A final improvement which I made after I had my final footage was to make the recording stop and then start just before the final ENTER key was sent for each snippet. My demo involved speeding up the "typing" portions, then freeze framing when I was ready to discuss something. This almost always happened right after the snippet was done typing. With this in place, I could have saved myself a lot more time as I wouldn't need to manually seek to those points and snip. I could also extract the frame to be frozen automatically as well.

Audio

Originally I captured audio using OBS and then separated them after the fact. This tended to be a bit more combersome. I eventually switched to audacity and, though I can't explain it, it sounded better. Regretably I already had most of my audio recorded so I only used it for a few smaller fixups. When you know which parts are with audacity, you can hear the difference.

Editing with Kdenlive

I am very happy with Kdenlive. It allows you to import many videos into a project bin, create folders, create sequences where you order clips, shorten clips, and so on.

I used folders for sections, and each folder had a primary sequence. I then had a main sequence outside of all of the folders which combined the smaller sequences. I didn't like the main sequence. When subsequences shrunk or grew, the "clips of sequences" used by main were not resized automatically resulting in the occasional black frame or sliced section that I had to watch out for.

It would have been nicer if I could tell Kdenlive "This sequence is a concatination of these other ones. Deal with it" but I couldn't find the means to do so.

Freezing frames was far easiest when a frame was converted to a picture, then used. Shift+R slices a clip in a sequence at that point, so you could slice the last frame and then use CTRL+drag to resize it. That frame or few would play super super slowly, which for 1 frame is a freeze frame. Mistakes were frequent though because if you didn't hold CTRL down, then you accidentally added more frames to the little clip you expected to be a freeze frame.

Kdenlive also allowed zooming which saved my bacon. I finished the video, watched it on my desktop, and was happy. I then switched to mobile and yikes. Text was far to small. I ended up doing another full editing pass zooming in on parts that mattered. Fortunately the tooling made this easy. I also placed boxes for focus here which worked out well.

I did have an issue where kdenlive started freezing whenever I viewed PNGs in it and I needed to clear the project cache to make it all work again. All and all, I will use it again in the future.

Lessons

  • Automated typing with virsh send-keys works well
  • Race conditions in the Ubuntu installer are irritating
  • Smaller clips are easier to manage
  • Be strict with file names
  • Your fonts are still too small for mobile
  • Voice-over is easier than in-situe recording
  • Slides for starting and ending work well

The Results

If you'd like to see the presentation which taught me all these lessons, you can find it here:

Time

Finally, expect the first time you do this to take 10x more than you think. Although it was easy to go time-blind working on this, the editing (and the rest) was very time-expensive.


© 2026 Christopher Prevoe.
All rights reserved.
prevoe.com