Saturday, January 19, 2013

A foray into video recording and editing

I'm fully aware it's been a very long while since I discussed anything technical on this site, and that makes me feel a little sad as that was the original point.  I had been somewhat hindered by the fact that there was very little I was doing outside of work that seemed interesting, and a lot of what I was doing in work was too difficult to make generic enough to not get me in trouble.  However, since I had started doing YouTube Let's Play videos (as mentioned previously) I've got something that's pretty interesting and somewhat technical, so here we are.

Let's Drink to Gaming is a Let's Play show with themed cocktails.  I wanted this to be a little more interesting than just playing a game and narrating what's going on, so I decided that I would play with a rotating cast of guest hosts over the internet.  This leads to a somewhat interesting challenge of broadcasting the game video to the other person while simultaneously recording it.  It also raised the question of how to record multiple audio sources, and broadcast multiple sources.  I needed to hear and record their voice, they needed to hear me and the game.

I did some wandering around Google and tried: XSplit, FFSplit, Fraps, Taksi, Bandicam, and I think "GameCam"?  Eventually I settled on Dxtory.  It's paid software but it has a lot of features that were really important in my situation that only really XSplit also mirrored, and since XSplit uses a subscription pay model Dxtory is technically cheaper.  The most important features Dxtory has are:
  • The ability to record an arbitrary number of audio streams.
  • The ability to stream the video it's recording to several DirectShow contexts.
Almost every other program only recorded 2 audio streams, if that.  They're really well setup for traditional commentary recording where you want the game and a microphone, but I was obviously biting off a bit more.  Since starting I've recorded up to 4 tracks at once: Game audio, my friend Tim and his fiancĂ©e over Teamspeak, myself on a headset mic, and my girlfriend on another local mic.  Being able to isolate all these lets me mix everything independently while I'm editing the final video so I can do some EQ and noise removal, basically make a run through and try to clean up the audio as much as possible.

Streaming via DirectShow is the way most webcams work, so since Dxtory can do that, I have a lot of options for video conferencing or streaming software.  I tried Skype first since it's super-easy, but the video quality is awful.  Skype uses 640x480 streams.  We've been trying to get RTSP with VLC working for some time can't quite get it over the internet.  I have a sneaking suspicion Verizon may be blocking RTSP.  I had also briefly toyed with the idea of using a game streaming site like Twitch and maybe making the channel private, if that's possible, but the lag on my stream was unbelievable.  I just recently found out this was because one of the utilities which came with my motherboard, a bandwidth prioritization utility, was devoting almost all my network resources to a Synergy server.  So maybe this is an option again.  I should also revisit the VLC tests in case bandwidth was an issue.

Audio mixing for the live feed was still unanswered.  This market is unfortunately less varied and most of it is paid software.  I tried without success using PulseAudio for windows, Jack for windows.  Eventually I bought Virtual Audio Cable.  VAC lets you create virtual audio devices on your PC and also arbitrarily route real and virtual devices.  This has been really important when we've played non-co-op games and had my girlfriend in the room with me.  I can use VAC to combine both of our microphones, and the game audio into a single device and make Teamspeak use that as its microphone while not affecting my ability to record all 3 of those sources alone.

So once I recorded everything I end up with a few gigs of x264 encoded AVI files with separate audio streams.  All the post-production work is done in Linux.  The software for windows I bought to record and stream was pretty cheap, and they were the only programs I saw with the featuresets I wanted.  Video editing software, however, is really freaking expensive.  I tried some free programs for windows, but they were all terrible.  Nothing could even match the feature set of of Adobe Premier Elements or Windows Movie Maker.  So I went to Linux where there were at least a few programs for me to choose from: Cinelerra, KDEnlive, and OpenShot.

I made my first video in Cinelerra but it was clunky, old looking, unstable, and couldn't export quickly or easily.  I wound up rendering the audio separately, and the video into a ludicrously large MOV, 80 gigs or something, then muxing the two together and reencoding on the command line.  Since then I've been using KDEnlive and it is much much better.  It still crashes and it has some clunkiness around certain tasks or filters.  I'd love some project templates and previewing animated title cards has some problems.  Also, it had this super-strange audio glitch that made creating the clip show utter madness.  I may try OpenShot soon, since it looks really good but I have nothing on it now.

I have a shell script that invokes ffmpeg to extract all the audio streams from the video file so I can work with them in Audacity.  Audacity seems like the go-to cross platform audio program, so I use that to import all the tracks, then run noise removal and run a pre-amp on anyone who seems too quiet.  Then I basically listen to the entire project covering up bits of keyboard noise or other unwanted sounds and if anyone talked over anyone else, bring out whoever said something better.

Anyway, that's the basic setup:
VAC to setup the audio so everyone can hear what they need.
Dxtory to record all the audio to independent data streams and output video in a usable format.
Google Hangouts to stream video to the remote commentators.
Audacity to clean and mix the audio into a single track.
KDEnlive to put everything together into the final video.

Yeah, this is long winded, but at least I'm talking about software again.  Maybe I'll post the bash script next time I boot linux to do some work.

No comments: