capturing CBC Radio from an internet stream

D. Hugh Redelmeier hugh-pmF8o41NoarQT0dZR+AlfA at public.gmane.org
Mon Mar 3 05:35:36 UTC 2008


| From: Eric Battersby <gyre-Ja3L+HSX0kI at public.gmane.org>

| I have not used ogg vorbis before.
| I don't have any portable "MP3 players" that plays that format
| and I've had about 10 players in the past.

I have some that do.  Samsung ones, before they were taken over by
PaysForSure.  Ditto for iRiver (but I don't have them).

| I assume you are capturing it from:
| 
|   http://vorbis.nm.cbc.ca/cbcr1-toronto.ogg

I think that is the one I used.  At one point their nameserver was
broken and I had to hardwire the IP address.  I told them and
eventually it got fixed (not clear if there was a causal relationship)

| How are you capturing it?

I used curl.  Here's the script I used:
    # grab 61 minutes of CBC Radio 1
    # NOTE: stupid CBC name server is broken
    #OGGTRIAL=oggtrial.nm.cbc.ca
    OGGTRIAL=159.33.6.141

    DATE=`date +%Y.%m.%d-%H.%M`
    curl --max-time 3660 -o $DATE.ogg
    http://$OGGTRIAL:80/cbcr1-toronto.ogg

Originally this worked fine.  Perhaps a year later, it seemed to often
stop about 30 or 40 minutes in.  Which was annoying.

| I got a 36s segment OGG file.  It appears that some history is captured
| in the stream also.

What do you mean by "history"?

| Could you break your shows into segments shorter than 1h, if 1h
| is a problem?

Sure, but what do you do with the seams?  I don't like
discontinuities.

| I hadn't heard of 'mmsrip'.  That seems to be a good tool.
| I haven't done much capturing, but I have used VLC (gui based), or this:
| 
|    mplayer.exe -dumpstream mms://somehost.com/somedirectory/somefile.wmv

Is this under DOS or MS Windows?  What's this ".exe" thing?

| Why rely on alternate timezones which are arbitrary, instead of
| a general solution?
| Why not set up a daemon to capture the stream every N minutes,
| along with some cleanup routines?

You mean capture the radio all the time?  That seems a bit rude:
wasting CBC's bandwidth for no good reason.  It would waste disk space
too unless I threw it away regularly (which proves that the bandwidth
was wasted).

| Why bother with WMA format at all?  I had a player from several
| years ago that played WMA files.  It does not play today's WMA files.
| Convert it to MP3, so it will work in ALL MP3 players.
| I know, the quality suffers slightly converting lossy to lossy,
| but this is not high fidelity music we are talking about.

The sound is bad enough.  I don't wish to make it worse.  So I would
have to use a high mp3 bitrate.  Then I would waste disk space.  And
waste flash memory in the player.

I admit that this is theory.  I haven't tested.  But there is only one
way for sound to come out through a lossy codec: worse.

| I tried this:
| 
|   $ ffmpeg -i cbc01.wma  cbc01.mp3
|   $ file cbc01.mp3
|   cbc01.mp3: MPEG ADTS, layer II, v1,  64 kBits, 44.1 kHz, Monaural
| 
| Unfortunately, it produced an MP2 file, not MP3.
| I am not sure what is wrong.  MP2 is similar,
| but may not be supported on all MP3 players.

I don't know what all the darned codecs are.  ffmpeg does have a flag
(-formats) to print a list of supported codecs (the list depends on
how it was compiled, for example).  It also has a flag (-acodec) to
specify the audio codec to use.  I'd say RTFM but, in the case of
ffmpeg, that would be very cruel.

| Also, I don't like MP3 files longer than 10m because
| many MP3 players do not have a "very very fast-forward", nor
| a rewind into the end of the previous track.

I've yet to deal with this.  My preferred players have an option to
resume where they left off.  This is mostly good enough.

I intend to try RockBox.  I have even bought a Sandisk e2xx player to
run it.  I intend to hack it to do what I want.  But I haven't even
installed RockBox yet.

| About your player:
| You have a "Creative Zen V".  I used to have a "Creative Muvo 2GB White"
| and it was one of the worst I have had; I had to return it.
| Here is a list of the problems from my notes which may or may not
| be relevant in your case:
|   - will freeze up if there are symbolic links or shortcuts
|   - will not play files deeper than 3 folder levels
|     - that is unacceptable
|   - must use predefined root folders
|   - no way to skip current folder, except by skipping tracks
|     or going to the menu and choosing skip folder
|     (problem is that it doesn't keep track of where you were)
|   - skipping folder always starts at the root of the default folder
|   - pops and clicks were heard randomly, about 6 per hour
|     (confirmed as systemic on some web forums)

Players seem to get worse, not better.  I don't use my ZenV much.  It
doesn't think that it holds files, it thinks it holds music.  So
instead of UMS (USB Mass Storage -- looks like a disk), it has another
protocol (perhaps MTP / PaysForSure).  So you navigate through albums
and artists and other things for which I have not internalized a model.
I put stuff on it using gnomad2.  I had to hack on that to get it to
work on x86_64 (so I now have check-in rights on the development tree).

My Samsung devices are UMS because I found firmware for other places
(Singapore?) that did this.  The stock North American firmware is MTP
/ PaysForSure.  Grrr.  I think that the UMS firmware supports ogg
vorbis, but I don't know for sure.

To get PaysForSure branding, Microsoft required player manufacturers
to drop ogg vorbis support.  When this was pointed out to anti-trust
folks, Microsoft said "oh, we didn't really mean it".  But the damage was
done -- I don't know of any PaysForSure licensees that now support ogg
vorbis.  If I were a licensee, I would not trust that MS actually
meant their "we didn't really mean it".
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list