-{ a hewer of maps }-

Record internet radio with VLC, updated

I needed to record a CBC radio piece today. For most cases, it appears the easiest route is to use streamtuner and streamripper, however there is something about my particular computer or CBC’s streaming style that made it difficult for me. Since it took a couple of hours to figure it all out, I figured I’d better save it for future reference. So here is a vlc only method which works, but with more clicks and it’s is easier to select a combination of options that don’t work than do. This is the combination which finally worked for me:

It’s the audio codec part which tripped me up the most, even though I was saving mp3 selecting mp3 as a code yields a 0 byte file.

For command line use, copy the source and destination urls from the dialogs created above, however it is necessary to change the syntax somewhat. Namely the :sout option needs to be single quoted.

vlc http://www.cbc.ca/listen/streams/r1_whitehorse_32.htm ‘:sout=#transcode{acodec=mpga,ab=96,channels=2}:duplicate{dst=display,dst=std{access=file,mux=raw,dst="/home/matt/Radio/cbc-north.mp3"}’

Here is the same in a bash script, you should only need to edit the INSTREAM and OUTFILE lines to use elsewhere

#!/bin/sh NOW=$(date +%F_%k-%M) INSTREAM=http://www.cbc.ca/listen/streams/r1_...ehorse_32.html OUTFILE=/home/shared/Audio/Radio/cbc-north_$NOW.mp3 echo … echo …Recording CBC North internet radio to echo    $OUTFILE echo …expect a 5 second delay before hearing anything echo …and a few “access_mms” errors prior to that. echo … /usr/bin/vlc $INSTREAM ‘:sout=#transcode{acodec=mpga,ab=96,channels=2}:duplicate{dst=display,dst=std{access=file,mux=raw,dst="'$OUTFILE'"}}’


Thanks for writing up the howto on the use of headless vlc to capture streaming audio.\ \ It took a little experimentation to make it work on my hardware (an arm-based pogoplug v4).  I don't know if the changes are due to newer versions of vlc or pertain more to how it was built for the pacman database that arch linux uses (the os that's running on my pp4).  Either way, I thought I'd send what I did your way in case you were interested in updating/adding to the howto.\

#!/bin/sh NOW=$(date +%F_%k-%M) INSTREAM=http://www.wwoz.org/listen/lo OUTFILE=/home/user1/wwoz_$NOW. mp3 echo echo recording WWOZ echo cvlc $INSTREAM --sout "#transcode{acodec=mpga,ab=96,channels=2}:std{access=file,mux=raw,dst="$OUTFILE"}"\

I wound up using cvlc as opposed to vlc so that it wouldn't complain about dbus access (lack of X11 really).  There's something I have yet to sort on the output file side as libmp3lame complains "[libmp3lame @ 0xb3e80] channel_layout not specified".  It does record, but what the exact parameters it writes the file with I haven't yet looked into.\ \ Regards,\ John\ \ \<John D. Doyle III>


What does your Map projection say about you? » « Spring, Cycles