howto rip Real Audio streams to mp3 on Ubuntu
| 14-Apr-2008 | Posted by Sonia Hamilton under Audio, Ubuntu |
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
Links
- Convert Real audio to MP3 using Linux
- Converting Real Audio Streams to MP3
- Recording streaming audio with MPlayer
- Problems with streaming Real Audio files
- BBC RealPlayer – make your voice heard!
Share This
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.
Thanks Andy, you’re welcome! Sonia.
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.)
“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…
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.
@ 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
yep splendid method .
Till now I was using http://www.tubeleecher.com