Archiving YouTube Livestreams

699 words.

I mentioned this briefly before, but I thought I’d break it out into a separate post. I’ve been livestreaming a bunch of videos to YouTube this month as part of the Steam Backlog Bonanza. It’s unlikely, but it’s possible that someday, YouTube will shut down and everything on their site will disappear, so I also download a copy of each video to a local hard drive.

Originally I had planned to record a local copy of the video while streaming at the same time. It turned out that didn’t work so well. CPU usage spiked all over the place, the stream stuttered and lagged, and it was a disaster. It also annoyed me that OBS won’t record at 60 fps while streaming at 30 fps, and certain encoders won’t allow recording and streaming at different resolutions.

Incidentally, while I’m here, I don’t think I ever explained this: I had originally planned to use Twitch for my Steam Backlog Bonanza, but it occurred to me that a) I don’t like Twitch b) I don’t have a Twitch audience c) I don’t want to monitor the chat d) Twitch video quality is awful e) my content doesn’t fit with Twitch streamer culture, which is more about building a cult of personality than broadcasting videos. It’s talk radio, not a radio play.

But most importantly, I already have a YouTube channel with at least a handful of followers. It would be silly not to build on that if I could.

The nice thing about livestreaming to YouTube is the videos automatically show up on your channel, just as if you had uploaded them. But to keep a local archive, you have to download a copy from YouTube. They provide a very handy menu for doing just that.

The bad news is that I discovered, quite by accident, that it doesn’t download the same video that was livestreamed or the same video that it plays on its site. I noticed that all of my downloaded videos were 720p, not the 1080p that I streamed them.

I’m sure everyone knows this, but YouTube internally keeps several different copies of each video encoded at different resolutions. Something like: 240, 360, 480, 720, and 1080. While I’m livestreaming at 1080, they are transcoding to all the different resolutions before storing it on their data centers. (That’s probably what it’s doing during the time it says it’s “processing” uploaded videos.)

I just assumed that when I downloaded one of my own videos, it would download the best quality version of that video, at the same quality that it was uploaded. Or at the very least, the same resolution that it was uploaded. But apparently not.

Maybe there’s a setting somewhere in YouTube to control this, but if there is, I don’t know about it.

After a little bit of Googling, it turns out there’s a tool called 4K Video Downloader that gives you detailed control over downloading videos from YouTube.

There’s a free version, and a paid version with extra bells and whistles, including the ability to download all videos in a playlist. I think it’s around $15, but the free version is adequate for my needs, as I only download one video at a time.

All you have to do is copy a link to the video you want to download and run the program. Then just click the green “Paste Link” button at top of the window. It’ll have a red icon on the button when there’s something in the clipboard. It thinks for a moment, then you’re given a choice of which version of the video to download and where to put it.

I’ve noticed that sometimes it takes a few tries for the download to complete. Sometimes it doesn’t download the entire video, and just truncates off the end. You can tell when you seek to the end of the video in a player and the playback freaks out. It also takes YouTube a little bit of time to get the livestream processed, so you usually have to wait an hour or more after the stream is done before you can download.

Now I just have to download all of my videos again.

This page is a static archival copy of what was originally a WordPress post. It was converted from HTML to Markdown format before being built by Hugo. There may be formatting problems that I haven't addressed yet. There may be problems with missing or mangled images that I haven't fixed yet. There may have been comments on the original post, which I have archived, but I haven't quite worked out how to show them on the new site.

Note: Comments are disabled on older posts.