Pandemic Journal, Day 615

I finally finished extracting all of the clips I need for my speech tomorrow. I wanted to avoid using the “Share Screen” option in Zoom, so I planned to use Open Broadcast Studio and set up a scene which would just show me, and another scene which would show a clip; I could fade between them and it would look professional.

I got the video to work easily, but I spent a long time trying to get the audio under control and failed; I even installed a virtual audio router but had no success – I couldn’t get the audio from the clip into Zoom, even though OBS showed that input as active.

I finally gave up, which is ironic since I’m using clips from Galaxy Quest!

Pandemic Journal, Day 614

A few days ago, I wrote about optimizing the process of extracting short segments from a video file to avoid having to copy the entire source video. My improvement was simple, elegant, and wrong – when I looked at the video I created, it didn’t start where I expected; it started and ended early every time. I “fixed” the problem by telling the program to add a little time at the end and by using QuickTime to trim the video by hand, but that seemed silly.

Today I figured out the problem. I’d assumed that when I told ffmpeg to extract a piece of video starting at a particular time, it would do that – but it can’t. It has to back up to the most recent “key frame” in the video, so the starting point will be a little earlier than specified, which threw off the rest of the calculations in the script and gave me a trimmed video that started and ended too early.

So in the end, I wound up writing unnecessary (and ugly) code that did more processing than necessary to extract a clip that I still had to edit manually anyway.

Premature optimization is the root of all evil.