sonia hamilton – life on the digital bikepath – sonia@snowfrog.net

14 April 2008

howto rip Real Audio streams to mp3 on Ubuntu

Filed under: Audio, Ubuntu — Sonia @ 16:49

I enjoy listening to podcasts during my commute, and most podcasts can be easily downloaded using my favourite podcasting tool (currently customised bashpodder, but I’m writing my own). But unfortunately some broadcasters (for example a large British one) persist in using weird proprietary formats like “Real Audio”. Bah! By the curse of RMS’s Beard!

There seems to be conflicting advice (see links below) on how to rip Real Audio to mp3, here’s how I got it going on Ubuntu 7.10:

First of all I installed Real Player using instructions here and here, and checked I could listen to a stream using the GUI tool – a quick sanity check for firewalls, etc.

  • add repo deb http://archive.canonical.com/ubuntu feisty partner
  • sudo aptitude install realplay

Then I installed mplayer and lame: sudo aptitude install mplayer lame. I got the source for a stream by right clicking a link, saving it as file, extracting the rstp:// url out of the file, and tested downloading:

$ mplayer rtsp://xyz.net.uk/foo.ra -ao pcm:file=audiofile.wav -vc dummy -vo null

And it failed with these errors:

Opening audio decoder: [realaud] RealAudio decoder
Error: /usr/lib/win32/sipr.so.6.0: cannot open shared object file: No such file or directory
Win32 LoadLibrary failed to load: sipr.so.6.0, /usr/lib/win32/sipr.so.6.0, /usr/local/lib/win32/sipr.so.6.0

So I located the sipr.so library, and based on the error message and digging around in mplayer using strings I linked the installed realplayer codecs to /usr/lib/win32:

$ sudo find / -type f -name “sipr.so”
$ strings /usr/bin/mplayer | grep usr
$ sudo ln -s /usr/lib/realplay-10.0.9/codecs /usr/lib/win32

I repeated the above mplayer command (which worked) then converted to mp3:

$ mplayer rtsp://xyz.net.uk/foo.ra -ao pcm:file=audiofile.wav -vc dummy -vo null
$ lame -h -b 128 audiofile.wav audiofile.mp3

Now, all this works for pages that have a direct link to a .ram file. But some sites (for example the BBC) have an embedded Real Player that hides the links to the .ram file – here’s how to find the .ram file:

  • click on the link and start playback the embedded Real Player in Firefox
  • a file called ~/.realplayerrc will be created – towards the end of the file there will be a section like this:
  • [recent_urls]
    url0=file:///tmp/foo.ram
  • cat the /tmp/foo.ram file, and copy the rstp:// link – ignore the part after the ? (the UID, etc)
  • follow the above instructions for ripping :-)

Links

7 Comments »

  1. Thanks for this tip. I have written a script which will take a certain bbc 6 music show and convert it to mp3 for use on my Creative Zen. It runs at 4am on Monday morning and by the time I get to my Desktop the music file is ready.

    Excellent work Sonia.

    Comment by Andy Mac — 21 September 2008 @ 00:47

  2. Thanks Andy, you’re welcome! Sonia.

    Comment by Sonia — 22 September 2008 @ 09:46

  3. From the above text:

    “I repeated the above command (which worked) then converted to mp3:”

    do you mean this command:

    $ mplayer rtsp://xyz.net.uk/foo.ra -ao pcm:file=audiofile.wav -vc dummy -vo null ?

    Is there a way to rip a stream using Audacious? Is vsound ‘out of date’ software?

    Also, if I use MPlayer and LAME, do I have to use the MPlayer in firefox as an embedded device? I would like to know how to do this on “stand alone” applications (using the command line, A-OK with me.)

    Comment by Mark_in_Hollywood — 15 December 2008 @ 09:23

    • “I repeated the above command” – yes “$ mplayer rtsp://xyz… As for audacious, vsound, mplayer, lame, I don’t know :-) I haven’t played around with this for a while – I now watch videos on the bus rather than listening to podcasts…

      Comment by Sonia — 15 December 2008 @ 10:19

  4. Nice tip! Though it doesn’t seem to work anymore…

    I don’t have a ~/.realplayerrc

    I do have a ~/.macromedia directory, but it doesn’t seem to contain anything helpful.

    Any other thoughts? Thanks.

    Comment by Macho Philipovich — 2 August 2009 @ 01:31

    • @ Macho Philipovich…
      I think you might find the file appears again if you use the link towards the bottom of the window which is for the low bandwidth version, this should enable the realplayer playback again instead of the flash version.
      Not tested, but I know that the main files are flash-based media… hth

      G

      Comment by G-sus — 2 October 2009 @ 21:30

  5. yep splendid method .
    Till now I was using http://www.tubeleecher.com

    Comment by JohnXY — 23 October 2009 @ 06:17


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.