Extending MPlayer

(February 9, 2006)

For quite some time now, I always wanted to record songs from my favourite radio station. However, there was a problem: They only offer a RealMedia stream (at only 44 kbps, but the codec is remarkably good, on par with WMA or Vorbis), which is not as easily recordable as, say, HTTP streaming. However, with the help of the original binary codecs, MPlayer is able to play the stream – so it had to be possible to record it. Unfortunately, MPlayer’s –dump options only record the compressed stream, and MEncoder refuses to transcode it into something usable (.wav, .mp3, …) because it always expects a video stream to be present. Furthermore, none of the dump or transcode options are able to play the stream while recording.

This had to change. And since I had a MPlayer-for-Win32 build environment on my box anyway, this was the right time. After some reasoning, I came up with a functional solution that doesn’t require twiddling around in MPlayer’s innards too much: an audio filter. If –af lame is put into MPlayer’s audio filter chain, it simply encodes all audio samples that pass by into an MP3 file on disk. MPlayer’s audio output is still active, thus an MP3-encoded audio dump is created on-the-fly during playback.
Read more …

My second patch …

(February 7, 2006)

I just submitted my second patch to a public open-source software project. The first one was about one or two years ago, a new feature for a not-too-famous image viewer named QIV. The project I submitted today’s patch to is, erm, somewhat bigger: it’s MPlayer. It’s a patch for the DirectX video output driver that used to take 100% CPU time on some (but not all) systems.
Read more …