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 …