VLC is the Magic Bullet of digital multimedia. It plays, records, transcode, and streams CDs, DVDs, and just about every video and audio format known to man. It can convert Flash videos from YouTube into MP3 files, which can help feed the need for free music. On that note, see also Songerize, and my Greasemonkey script to download songs from that service.
This morning, it hit me: why not record streams using VLC? After a little fiddling (and a lot of searching, I finally figured out how to do it:
- Open up VLC, then select File->Open Network Stream (or just press Ctrl+N).
- Enter the address of your stream in the box at the bottom.
- Check the “Stream/Save” box, then click the Settings button.
- The “Stream Output” dialog will open. Under the Outputs group, select the “Play locally” and “File” boxes. Click the “Browse” button and select the file to save to.
- Under the “Encapsulation” group, select the “Raw” option.
- Under the “Transcoding options” group, check the “Audio codec” box, and select “mp3″ from the drop-down box. The default options should be fine.
- Click “OK” in the Stream Output and Open dialogs. Your stream will start playing. VLC will convert it to MP3 format and save it to the file you selected in the background.
- If you’d like, you can mute VLC and go get coffee or something. Unless your stream gets disconnected, it’ll keep recording.
- To stop recording, click VLC’s stop button.
- Your MP3 is ready to use!
You can create a batch file or script to do this automatically. I haven’t quite figured out how to do it, but I do know VLC’s command-line mode makes it possible. You can then set up a scheduled task (on Windows) or cron job (on *nix) to automate the process of recording. More on that when I figure that part out.