I participate in a project funded by (Taiwan's) Ministry of Education to record lectures (in Chinese of course). The topics I talk about is free software of course. (Specifically it's Dr. Geo and gnuplot but that's irrelevant to this post.) Unfortunately the platform for recording the lectures is Microsoft Windows. This makes me feel like going on the stages with only underwear, to talk about the importance of dress code. It was bad enough that I had to do this last year. This time I shall try to do it using Linux.

Quick summary: One can get recordings of reasonable quality using Linux. We need more non-techie tutorials about doing these things.

Here are the steps I have taken:

  1. Record using xvidcap.
  2. After all recordings are finished, extract ("demux") all sound tracks using ffmpeg:
    
    ls | sed 's/\.mpeg//' > ~/file-list.txt
    for f in $(cat ~/file-list.txt) ; do ffmpeg -i $f.mpeg -vn $f.mp3 ; done
    
  3. Manually reduce noise for each .mp3 file using audacity
  4. Join ("mux") the mp3 files back into the video in a batch:
    
    for f in $(cat ~/file-list.txt) ; do mkvmerge -o $f.mkv -A $f.mpeg $f.mp3 ; done
    

For line-in recording, it's iGain that must be maximized

the line-in jacket (blue) The following are the details. Initially I had most trouble with sound recording. The volume was so small that the noise became intolerably large after increasing the volume using audacity. Eventually I figured out something that reveals me being a total audio-newbie: it's iGain (not microphone) in aumix that has to be maximized in order to get larger volume in recording, supposing that you connect using the line-in jacket (typically blue) and supposing that the chosen audio input device is /dev/dsp in xvidcap.

Another big trouble was audio-video synchronization. I still don't know why the audio and video was badly out of sync in my other computer but was quite ok in my final successful setup. There are uncaptured frames/audio in both cases (about 85-90% capture success ratio). But in the unsuccessful case the video was somehow automatically slowed down to match the capture success ratio, whereas in the successful case no compensation was done with either audio or video. I tried to use "effect => change tempo" to speed up the audio to match the video according to the capture success ratio and ended up only with synchronized start and finish. If anybody knows of the details, please point me to relevant documents. Incidentally, I use xubuntu in the final successful setup, hoping that by using xfce instead of gnome or kde, more resources are left for the recording job.

Audacity's "effect" menu is very worthy of exploration. "Amplify" increases the volume. Be sure to check "allow clipping" if there are a small number of spikes in your recording that prevent other parts to be amplified. "Noise removal" is a two step procedure: first select a few seconds of "supposed" silence to let audacity know what noise looks like, and then select the entire recording to do the real job. I prefer smaller removal effect in the second step. Here is a short clip to show its effect. original (I don't think you can hear anything), amplified, noise-removed.

getting noise profile
noise removal

To me, the easiest part was the batch commands for demuxing and muxing. You learn regular expressions and command substitution once, and it makes you look like a wizard ever since, whether the job at hand is image processing or converting proprietary file formats into open ones. By the way that's why I feel like requesting the audacity team to make their amazingly powerful brain child scriptable like sox. A final note: I learned of the matroska container format in this process. It seems to be technically better than ogg media according to the wikipedia comparison.

There seems to be a huge gap between the FLOSS audio-video developers and the casual users. The audio howtos such as The Sound Playing Howto are quite of out of date. If only some of the technically proficient people would step aside from their coding job and write some audio-video tutorials for us mere mortals, I am sure it would be greatly appreciated. Ideally it would not talk about any specific software in detail but would rather center around a task (like recording computer lectures) and make simple uses of many pieces of relevant FS.

Anyway I am glad that this time I am able to wear the right suite (and even the right underwear; but most people wouldn't care) to step on the stage to record FS lectures. :-)