Recording Computer Lectures on Linux
By HUNG Chao-Kuei on Tuesday, September 25 2007, 09:09 - Permalink
... One can get recordings (for computer lectures) of reasonable quality using Linux. We need more non-techie tutorials about doing these things.
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:
- Record using xvidcap.
- 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
- Manually reduce noise for each .mp3 file using audacity
- 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
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.
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. :-)
Comments
Dear Chao Kuei
We have (Odile and myself) just bought a video camera and found that the sound often needed reworking.
Also the controls for cards are highly non standardized: every card has a different set and I suspect it is also dependent on the model of driver's developer:-)
About video synchronization I have found that on mp4s when xine is forced to drop frames due to machine being too slow then it loses synchronization. I have found tha mplayer does not have that proble (and loses less frames).
Best wishes
Jean Francois
Hello Jean Francois, How nice to hear from you! Thanks for sharing the experience. I remember the out-of-sync problem seemed to be more related to the recording software than the playing software. I will do more experiments next time I record. Have fun with your video camera! (I suppose Odile's church singing was recorded with this :-) )
A few more notes and URL's:
mplayer -vo null -ao null -frames 0 -identify $(ls -tr *.mkv) | grep LENGTH
I read somewhere that
tcprobe -i introduction.mkv
could do similar things, but apparently it did not recognize the sound track of my mkv files. (tcprobe is in the transcode package.)Followed all the steps and successfully compiled and installed GM http://file.sh/gnome+torrent.html , but while adding it to a panel I get the hit to enable it via preferences. So I click preferences which show me a minimal dialog, resizing this the dialog doesn't contain any widgets (settings). Help...
This post's comments feed