Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Convert Real Audio files to MP3s UNIX
I enjoy listening to audio lectures on my MP3 player while driving or walking. However, many of these lectures are encoded as Real Audio, and could not be easily converted. I searched for a native OS X app that could perform this task, but found nothing. In the Windows world, programs like Streambox Ripper can convert Real Audio to other formats, but running VPC is not an option for me -- not to mention it's incredibly slow. By using a few freely available UNIX command line tools, and codecs from the OS X version of Real Player, one can easily and quickly convert Real Audio to MP3. What follows is a tutorial, including a shell script to automate the conversion process.

Prerequisites:
Before beginning, you will probably want to have some basic understanding of the command line, namely, how to copy files, use sudo, and set paths. You will also need to have LAME installed, and it should be in your path. This tutorial will not go into basic shell usage.

This hint builds off of this older hint, by correcting some mistakes, and attempting to automate the process a bit. You will need to obtain the newest mplayer and mencoder binaries from the mplayerosx page; the latest version is preferred. Secondly, if you do not have it already, you will need to download the free version of Real Player. Alternatively, if you do not want to download Real Player, the necessary codecs for this project can be obtained from the Helix DNA Producer program. If you choose to go this route, obtain the latest stable OS X releases.

Putting Everything Together:
After obtaining the necessary items, you will want to move the mencoder and mplayer binaries to a location in your path; /usr/local/bin is probably the best candidate. However, you may need to manually add it to your path, and also create the directory. To do this, use pico (or your favorite text editor) to create a file called .profile and place it in your home directory. It should contain the following line:
export PATH=$PATH:/usr/local/bin
After doing this, you will want to also ensure that LAME is in your path. If typing lame while in your home directory does not start LAME, then it is not in your path.

The next step is create a symbolic link to Real Player's codecs, so that mplayer can utilize them. While the previous hint suggests these are stored in /usr/local/lib/mplayer, this has changed in recent versions of mplayer. Assuming you have chosen to use the codecs included with Real Player, and have installed Real Player in your applications folder, create a link to them with the command below. Take note that you may need to create a folder labeled ffmpegX in /Library/Application Support before linking the codecs:
ln -s /Applications/RealPlayer.app/Contents/Frameworks/HXClientKit.framework/HelixPlugins/Codecs \
/Library/Application\ Support/ffmpegX/reallib
If you decided to use the codecs from Helix DNA Producer, create a folder under /Library/Application Support/ffmpegX labeled reallib, and copy the contents of the 'codecs' folder to that directory.

Automating the Process:
At this point, one could use mplayer to convert a Real Audio file to WAV, and then use LAME to encode it. However, this requires calling both apps with a series of flags and parameters that are too annoying to memorize. Instead, create a file named ra2mp3 using a text editor of your choice, and paste the following code inside it:
#! /bin/bash
#
# Converts a Real Audio file to a mono MP3 and adds an ID3 tag.
#
# Usage: ra2mp3 infile [outfile]
#
author=`mplayer "$1" -vo null -ss 10:00:00 | grep author | sed -e 's/.*:\\s*\\(.*\\)/\\1/'`
title=`mplayer "$1" -vo null -ss 10:00:00 | grep name | sed -e 's/.*:\\s*\\(.*\\)/\\1/'`
mplayer "$1" -ao pcm -aofile "$1".wav -vc dummy -vo null
lame -m m "$1".wav "$2" --tt "$title" --ta "$author"
rm "$1".wav
To use this script, you will need to copy it to somewhere in your path; again, /usr/local/bin is a good choice. It can then be evoked from any directory. Also, you will need to set the script to be executable; to do this, type:
chmod +x ra2mp3
The script is evoked with the following syntax:
ra2mp3 input.rm output.mp3
It will first run the input file through mplayer to determine its author and title. Then, using mplayer again, it will convert the file to a WAV, and take the author and title info to create an MP3 with matching ID3 tags. The WAV file used during the conversion process will be deleted automatically. Also, you may notice that LAME is being called with the flag -m m. Since I deal mostly with audio lectures, I convert the audio to mono; if you do not wish to do this, simply remove the flag from the script. Additionally, by typing lame at the command line, you can find a number of parameters that may be of personal use, and could subsequently be added to this script. Unfortunately, I know nothing of GUI programming, so if someone would like to make this process even easier, feel free :).

Conclusion:
I recommend making a backup of the mplayer and mencoder binaries, as well as the Real Player codecs. There is no telling when a change in either project may make this hint unusable (as it has in the past). You now have a file that can be used in any MP3 player, iTunes, or burnt to CD.
    •    
  • Currently 2.22 / 5
  You rated: 2 / 5 (9 votes cast)
 
[198,519 views]  

Convert Real Audio files to MP3s | 41 comments | Create New Account
Click here to return to the 'Convert Real Audio files to MP3s' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Convert Real Audio files to MP3s
Authored by: terceiro on Feb 01, '05 10:57:17AM

Unless I'm missing something, I'm going to have to compile LAME for myself. It's not that I *can't*, but that it takes more time (and thought, if I have to modify anything). I heart binaries.

Alas, I suppose I gotta do what I gotta do. I'm interested to try this hint. With a little more scripting, I can automate my All Things Considered and Prairie Home Companion. Dang, I love free UNIX tools.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: bedouin on Feb 01, '05 01:48:49PM
Here is a binary version of LAME in an OS X PKG format. I haven't tested it myself though. You also might want to look into something like DarwinPorts, which I've had good luck with (I prefer it over Fink).

[ Reply to This | # ]
Fink has no binary
Authored by: lullabud on Feb 01, '05 02:20:44PM

He's right, from what I can see fink has no binary... Lame.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: _merlin on Feb 02, '05 04:32:32AM

http://vastheman.paservices.com/

Scroll down to Mac OS X software. There's a PKG for version 3.96.1 which is the latest.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: linedhel on Feb 22, '05 09:41:16PM

I just compliled this literally yesterday and it was super easy. It was a typical:

./configure
make
sudo make install


that's it!

Michael



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: makeinu on Feb 01, '05 12:03:52PM
ffmpegx explains how to automate this procedure with their software. Technically it's shareware, but there is no limitation, just a nagware donation request.

[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: bedouin on Feb 01, '05 01:44:57PM
In my experimentation with ffmpegX before writing this hint, I could find absolutely no way to get it to convert Real Audio files. It seems to require that the Real file contain both video and audio, otherwise it just spits back an error. Either that or it's incapable of converting to MP3, I'm not sure which. However even if it did work the nagware side of it would be annoying too.

[ Reply to This | # ]
Audio Hijack Pro will convert Real Audio files to MP3s
Authored by: mclbruce on Feb 01, '05 12:25:05PM

http://www.rogueamoeba.com/audiohijackpro/

I think the standard Audio Hijack app will do this as well with the included AppleScripts.



[ Reply to This | # ]
Audio Hijack Pro will convert Real Audio files to MP3s
Authored by: DC Watts on Feb 01, '05 01:15:41PM

Yes, but isn't this a real-time process, as opposed to the approach taken in the hint?



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: Chas. Schoenfeld on Feb 01, '05 12:44:49PM

Wiretap, freeware from Ambrosia software, is an alternate way to accomplish this. As long as you can prevent your computer from making any other noises while you're playing the original.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: bedouin on Feb 01, '05 03:14:12PM

Or don't mind waiting an hour :)

Wiretap and its ilk are great for recording short 3 or 4 minute segments, but when dealing with hour-long lectures, or DJ sets, waiting in real time isn't an option, especially if you have more than one file to deal with.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: osxpounder on Feb 01, '05 05:11:12PM

I went to Ambrosia's web site. Wiretap is not free software. The only version available as of today is WireTap Pro, and it costs. The free version was limited, anyway, so you couldn't convert a half hour or more of audio without hearing some kind of audio watermark mixed in with it.

---
--
osxpounder



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: mactex on Feb 01, '05 10:18:11PM

I found this information concening WireTap Pro:
Users of the original (free) version of WireTap can continue to use WireTap Pro free of charge to record system audio to AIFF files. An audio "soundmark" is dubbed over your recordings if you use features not present in the original WireTap while using WireTap Pro without having registered it.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: peragrin on Feb 01, '05 06:32:35PM

Why not just

http://streamripperx.sourceforge.net/

it is real time, though most of the time you can't download .rm files anyway.

Since most people hide the real media streams. If you can actually download them, then your method would be better


---
I thought once I was found but it was only a dream



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: ThePhin on Feb 02, '05 12:23:56AM

I tried this.

- Installed RealPlayer10.
- grabbed latest*.zip and installed mplayer and mencoder into /usr/local/bin
- created the link to the RealPlayer codec dir, and for good measure, created a directory of links to the individual bundles in /usr/local/lib/mplayer

Doesn't do what is described:

<code>
megumi:~/Desktop] donaldwa% mplayer streamIt.ram -ao pcm -aofile streamIt.ram.wav -vc dummy -vo null
MPlayer dev-CVS-030914-12:11-3.1 (C) 2000-2003 MPlayer Team

AltiVec found
Reading config file /usr/local/etc/mplayer/mplayer.conf: No such file or directory
Reading config file /Users/donaldwakefield/.mplayer/config
Reading /Users/donaldwakefield/.mplayer/codecs.conf: Can't open '/Users/donaldwakefield/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf
font: can't open file: /Users/donaldwakefield/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using usleep() timing
Can't open input config file /Users/donaldwakefield/.mplayer/input.conf: No such file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file or directory
Falling back on default (hardcoded) input config

Playing streamIt.ram
Falling back on trying to parse playlist streamIt.ram...
============ Sorry, this file format is not recognized/supported =============
=== If this file is an AVI, ASF or MPEG stream, please contact the author! ===


Exiting... (End of file)
</code>

I can play avis just fine though...



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: bedouin on Feb 02, '05 01:08:04AM

This hint isn't for streaming audio, which is what you're trying to capture. If you want to capture streaming audio to WAV issue the following command:

mplayer -playlist file.ram -ao pcm -aofile file.wav -vc dummy -vo null

This, of course, won't convert the stream to MP3, nor add ID3 tags.

When you're done capturing the stream (if it is 24 hour), press enter and it should stop, otherwise I'm assuming it will stop by itself. If you add the "-playlist" toggle to the script I provided, it would probably work fine for .RAM (streaming) files as well.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: ThePhin on Feb 02, '05 01:31:59AM

Thanks! That got me farther. Still failing:

<code>
[megumi:~/Desktop] donaldwa% mplayer -playlist 214.ram -ao pcm -aofile file.wav -vc dummy -vo null
MPlayer dev-CVS-030914-12:11-3.1 (C) 2000-2003 MPlayer Team

AltiVec found
Reading config file /usr/local/etc/mplayer/mplayer.conf: No such file or directory
Reading config file /Users/donaldwakefield/.mplayer/config
Reading /Users/donaldwakefield/.mplayer/codecs.conf: Can't open '/Users/donaldwakefield/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf
font: can't open file: /Users/donaldwakefield/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using usleep() timing
Can't open input config file /Users/donaldwakefield/.mplayer/input.conf: No such file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file or directory
Falling back on default (hardcoded) input config

Playing rtsp://a1646.v18541.c1854.g.vr.akamaistream.net/ondemand/7/1646/1854/1104576338/www.wbez.org/ta/214.rm
Resolving a1646.v18541.c1854.g.vr.akamaistream.net for AF_INET6...
Couldn't resolve name for AF_INET6: a1646.v18541.c1854.g.vr.akamaistream.net
Resolving a1646.v18541.c1854.g.vr.akamaistream.net for AF_INET...
Connecting to server a1646.v18541.c1854.g.vr.akamaistream.net[63.241.204.7]:554 ...
Cache size set to 640 KBytes
Connected to server: a1646.v18541.c1854.g.vr.akamaistream.net
Cache fill: 18.75% (0 bytes) REAL file format detected.
skip_str: 45 bytes skipped
skip_str: 20 bytes skipped
======= WAVE Format =======
Format Tag: 28515 (0x6F63)
Channels: 1
Samplerate: 44100
avg byte/sec: 64082
Block align: 744
bits/sample: 16
cbSize: 18
Unknown extra header dump: [0] [ba] [0] [14] [0] [e] [2] [e8] [0] [8] [1] [0] [0] [2] [4] [0] [0] [2f]
===========================
Clip info:
name: #214 Family Physics - This American Life
copyright: (C) 2005 WBEZ Alliance, Inc. - Ira Glass
==========================================================================
Requested audio codec family [racook] (afm=realaud) not available (enable it at compilation)
Requested audio codec family [racookwin] (afm=realaud) not available (enable it at compilation)
Cannot find codec for audio format 0x6B6F6F63.
Read DOCS/en/codecs.html!
==========================================================================
Audio: no sound
Video: no video


Exiting... (End of file)
</code>

Here are the codecs that came with RealPlayer10:

<code>
[megumi:~/Desktop] donaldwa% ls /Library/Application\ Support//ffmpegX//reallib/
atrc.bundle cook.bundle drv2.bundle raac.bundle rv20.bundle rv40.bundle
colorcvt.bundle drv1.bundle drvc.bundle rv10.bundle rv30.bundle sipr.bundle
</code>

I'll try Googling for racook tomorrow. Thanks.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: bedouin on Feb 02, '05 02:11:36AM

Two things to verify. First, make sure you downloaded the files from the Sourceforge link entitled "last mencoder & mplayer binaries." I wrote this is in the original submission but I guess the editor thought it was a mistake and changed it to "newest" or something to that effect.

Second thing, make sure you linked the codecs exactly as described. Aliases created with Finder DO NOT work. It appears you've done something awkward at the linking stage. If you can't figure it out, copy the files to the ffmpegX directory. If you haven't done anything wrong with linking, the version of mplayer you're using is looking for the files in another place; use the newest version.

Lastly, I was able to capture the stream in question (Family Physics) to WAV with no problem. I didn't complete the entire file, but it looked something like this . . .

Opening audio decoder: [realaud] RealAudio decoder
opening shared obj '/Library/Application Support/ffmpegX/reallib/cook.bundle/Contents/MacOS/cook'
Audio codec: [14] 64 Kbps - RealAudio
Audio bitrate: 64.083 kbit/s (8010 bps)
AUDIO: 44100 Hz, 1 ch, 16 bit (0x20), ratio: 8010->88200 (64.1 kbit)
Selected audio codec: [racookmac] afm:realaud (Mac OS X RealAudio COOK)
==========================================================================
Checking audio filter chain for 44100Hz/1ch/16bit -> 44100Hz/2ch/16bit...
AF_pre: af format: 2 bps, 1 ch, 44100 hz, big endian signed int
AF_pre: 44100Hz 1ch Signed 16-bit (Big-Endian)
[AO PCM] File: file.wav (WAVE)
PCM: Samplerate: 44100Hz Channels: Stereo Format Signed 16-bit (Little-Endian)
[AO PCM] Info: fastest dumping is achieved with -vc dummy -vo null
PCM: Info: to write WAVE files use -waveheader (default).
AO: [pcm] 44100Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 44100Hz/1ch/16bit -> 44100Hz/2ch/16bit...
Video: no video
Starting playback...
A:1536.2 (25:36.1) 98.1% 0%

Exiting... (End of file)

Just as a precaution I checked my hint from beginning to end on another machine without LAME, mplayer, or any other stuff installed. I didn't encounter any problems.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: ThePhin on Feb 02, '05 10:49:47AM

Okay, I'm running Mac OS X 10.3.7. I have Real Player 10.0.0 (v325).

I went to the mplayer Sourceforge link you supplied, and followed the link labelled "Last Mencoder&Mplayer binary". I was offered multiple choices for a download, and took ffmpegxbinaries.sit. This yielded a folder, binaries_for_ffmpegX. Then I Unix cp'ed 'em:

<code>
[megumi:/usr/local/bin] donaldwa% cp /Users/donaldwakefield/Desktop/binaries_for_ffmpegX/m* .
[megumi:/usr/local/bin] donaldwa% ls -l mencoder mplayer
-rwxr-xr-x 1 donaldwa staff 4549296 2 Feb 07:32 mencoder
-rwxr-xr-x 1 donaldwa staff 4658648 2 Feb 07:32 mplayer
</code>

From my Desktop location:

<code>
[megumi:~/Desktop] donaldwa% mplayer -h
Using GNU internationalization
Original domain: messages
Original dirname: /usr/local/share/locale
Current domain: mplayer
Current dirname: /usr/local/share/locale


MPlayer dev-CVS-030316-14:10-3.1 (C) 2000-2003 Arpad Gereoffy (see DOCS)
</code>

(etc. ...)

As for the link to the Real Player codec support:

<code>
[megumi:/Library/Application Support/ffmpegx] donaldwa% ls -la
total 8
drwxr-xr-x 3 root admin 102 1 Feb 20:27 .
drwxrwxr-x 21 root admin 714 1 Feb 20:05 ..
lrwxr-xr-x 1 root admin 90 1 Feb 20:27 reallib -> /Applications/RealPlayer.app/Contents/Frameworks/HXClientKit.framework/HelixPlugins/Codecs
</code>

(and from my shell history:

64 20:27 sudo ln -f -s /Applications/RealPlayer.app/Contents/Frameworks/HXClientKit.framework/HelixPlugins/Codecs reallib
)

<code>
[megumi:/Library/Application Support/ffmpegx] donaldwa% cd reallib
[megumi:Application Support/ffmpegx/reallib] donaldwa% ls -la
total 16
drwxr-xr-x 15 donaldwa admin 510 1 Feb 20:23 .
drwxr-xr-x 6 donaldwa admin 204 1 Feb 20:23 ..
-rw-r--r-- 1 donaldwa admin 6148 1 Feb 20:23 .DS_Store
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 atrc.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 colorcvt.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 cook.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 drv1.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 drv2.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 drvc.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 raac.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 rv10.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 rv20.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 rv30.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 rv40.bundle
drwxr-xr-x 3 donaldwa admin 102 15 Dec 22:23 sipr.bundle
[megumi:Application Support/ffmpegx/reallib] donaldwa% pwd
/Applications/RealPlayer.app/Contents/Frameworks/HXClientKit.framework/HelixPlugins/Codecs
</code>

Finally, an attempt to convert the stream:

<code>
[megumi:~] donaldwa% cd Desktop
[megumi:~/Desktop] donaldwa% pwd
/Users/donaldwakefield/Desktop
[megumi:~/Desktop] donaldwa% ls -l
total 22448
-rw-r--r-- 1 donaldwa staff 102 31 Jan 08:53 214.ram
drwxr-xr-x 4 donaldwa staff 136 21 Jun 2003 binaries_for_ffmpegX
-rw-r--r-- 1 donaldwa staff 9208393 22 Jun 2003 ffmpegxbinaries.sit
[megumi:~/Desktop] donaldwa% mplayer -playlist 214.ram -ao pcm -aofile file.wav -vc dummy -vo null
Using GNU internationalization
Original domain: messages
Original dirname: /usr/local/share/locale
Current domain: mplayer
Current dirname: /usr/local/share/locale


MPlayer dev-CVS-030316-14:10-3.1 (C) 2000-2003 Arpad Gereoffy (see DOCS)

AltiVec found
Reading config file /usr/local/etc/mplayer/mplayer.conf: No such file or directory
Reading config file /Users/donaldwakefield/.mplayer/config
Reading /Users/donaldwakefield/.mplayer/codecs.conf: can't open '/Users/donaldwakefield/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf
font: can't open file: /Users/donaldwakefield/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using usleep() timing
Can't open input config file /Users/donaldwakefield/.mplayer/input.conf : No such file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf : No such file or directory
Falling back on default (hardcoded) input config

Playing rtsp://a1646.v18541.c1854.g.vr.akamaistream.net/ondemand/7/1646/1854/1104576338/www.wbez.org/ta/214.rm
Connected to server: a1646.v18541.c1854.g.vr.akamaistream.net
Stream not seekable!
Failed to initiate "audio/X-PN-REALAUDIO" RTP subsession: RTP payload format unknown or not supported
No stream found.


Exiting... (End of file)
</code>

The stream is playable by RealPlayer (I checked right after the above run).

I'll try deleting the symbolic link and doing a Unix 'cp -R' of the bundles into a genuine /Library/Application Support/ffmpegx/reallib/ directory this evening.

Thanks for all the help.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: bedouin on Feb 02, '05 01:30:14PM

You downloaded, possibly, the oldest binary. Get ffmpegXbinaries1115.zip.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: ThePhin on Feb 02, '05 11:26:57PM

That did it. Thanks for your patience.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: morey on Mar 15, '05 02:00:56AM

Hi

I ran into the same problems than ThePhin, plus this one:

[PowerMacG4:~/Desktop] morey% mplayer HowToStudyTheBible.rm -ao pcm -aofile HowToStudyTheBible.rm.wav -vc dummy -vo null
dyld: mplayer version mismatch for library: /usr/lib/libiconv.2.dylib (compatibility version of user: 5.0.0 greater than library's version: 3.0.0)
Trace/BPT trap

Thank you for your help



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: injust on May 02, '06 11:11:01PM
I too am trying to convert a stream to .wav, then to .mp3, in this case a segment of a Prairie Home Companion show. I got the newest binaries I could find, in this case Intel builds, and used the command for streams given in this thread, and it seemed to work perfectly:
~ jtb$ /usr/local/bin/mplayer -playlist audio_segment.php.ram -ao pcm -ao pcm:file=rope.wav -vc dummy -vo null
MPlayer dev-CVS-060307-04:23-4.0.1 (C) 2000-2006 MPlayer Team
Mac OSX static build for ffmpegX
CPU: Intel  (Family: 6, Stepping: 8)
FIXME:Hardenabling SSE and SSE2 without detection
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2


Playing rtsp://a754.v5559f.c5559.g.vr.akamaistream.net/ondemand/7/754/5559/v001/mpr.download.akamai.com/5559/phc/031101/031101_phc.rm?start=00:00:47:40.0&end=00:01:18:56.0.
STREAM_RTSP, URL: rtsp://a754.v5559f.c5559.g.vr.akamaistream.net/ondemand/7/754/5559/v001/mpr.download.akamai.com/5559/phc/031101/031101_phc.rm?start=00:00:47:40.0&end=00:01:18:56.0
Resolving a754.v5559f.c5559.g.vr.akamaistream.net for AF_INET6...
Couldn't resolve name for AF_INET6: a754.v5559f.c5559.g.vr.akamaistream.net
Resolving a754.v5559f.c5559.g.vr.akamaistream.net for AF_INET...
Connecting to server a754.v5559f.c5559.g.vr.akamaistream.net[209.170.95.71]: 554...
Cache size set to 640 KBytes
Cache fill: 12.50% (81920 bytes)   Stream EOF detected
Cache fill: 13.44% (88064 bytes)   
REAL file format detected.
Stream description: Audio Stream
Stream mimetype: audio/x-pn-realaudio
Clip info:
 name: A_Prairie_Home_Companion
 author: Minnesota Public Radio
 copyright: Minnesota Public Radio,2003
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 22050 Hz, 1 ch, s16le, 20.7 kbit/5.86% (ratio: 2583->44100)
Selected audio codec: [ffcook] afm: ffmpeg (FFmpeg COOK audio decoder)
==========================================================================
[AO PCM] File: rope.wav (WAVE)
PCM: Samplerate: 22050Hz Channels: Mono Format s16le
[AO PCM] Info: Faster dumping is achieved with -vc null -vo null
[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).
AO: [pcm] 22050Hz 1ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:  33.4 (33.4) of 7201.0 ( 2:00:01.0)  0.2% 0% 

Exiting... (End of file)
And in fact the file, rope.wav, was created. However, it converted only a little 33-second snip of the show segment (which is around a half-hour, I think) that I was trying to convert, and I'm not even sure what it created was from the right segment of the show. as you can see, at the end of the rtsp link, there's a timecode reference,
031101_phc.rm?start=00:00:47:40.0&end=00:01:18:56.0.
I believe that's the part that's messing up. Anyone have any words of wisdom for me? Thanks in advance.

[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: RiotNrrrd on Feb 02, '05 03:33:51AM
If you don't have a .ram file, as long as you can get at the original stream URL (via View Source or similar), you can do

mplayer -dumpstream -dumpfile [filename] rtsp://host.do.main/full/url

to dump live RealAudio streams to disk to create your own .rm files that you can then massage into MP3's.

As for this mess:

author=`mplayer "$1" -vo null -ss 10:00:00 | grep author | sed -e 's/.*:\s*\(.*\)/\1/'`
title=`mplayer "$1" -vo null -ss 10:00:00 | grep name | sed -e 's/.*:\s*\(.*\)/\1/'`


How about this instead?

IFS=";" title_author=`mplayer "$1" -quiet -vo null -ss 10:00:00 2>&1 | awk -F: 'BEGIN { ORS = ";" } ; $1 ~ /name|author/ { print $2 }'`
title=${title_author[0])
author=${title_author[1])


A little more legible to the uninitiated, perhaps ...

(And you get a free "Oh I didn't know awk was that cool!" and "Fun with BASH arrays" lesson out of it! ;-) )

[ Reply to This | # ]

Convert Real Audio files to MP3s
Authored by: RiotNrrrd on Feb 02, '05 10:39:44AM
How about this instead?

IFS=";" title_author=`mplayer "$1" -quiet -vo null -ss 10:00:00 2>&1 | awk -F: 'BEGIN { ORS = ";" } ; $1 ~ /name|author/ { print $2 }'`
title=${title_author[0])
author=${title_author[1])
<Mental note: "Do not post after bedtime.">

Forgot the parentheses for the array assignment. (Could've sworn I used Preview.) Let's try that again:

IFS=";" title_author=(`mplayer "$1" -quiet -vo null -ss 10:00:00 2>&1 | awk -F: 'BEGIN { ORS = ";" } ; $1 ~ /name|author/ { print $2 }'`)
title=${title_author[0])
author=${title_author[1])


[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: bluehz on Feb 02, '05 04:57:42PM

That is very cool - anyway - you could walk us through whats going on there?



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: grau on Mar 09, '05 05:30:28PM

With

mplayer -playlist http://www.radioeins.de/meta/sendungen/elektro_beats/miller_hour/20050302.ram -ao -pcm:file=20041103.wav -vc dummy -vo null
I get the following:


MPlayer dev-CVS-050123-19:55-3.3 (C) 2000-2005 MPlayer Team
Mac OSX static build for ffmpegX
AltiVec found
CPU: PowerPC

Resolving www.radioeins.de for AF_INET6...
Couldn't resolve name for AF_INET6: www.radioeins.de
Resolving www.radioeins.de for AF_INET...
Connecting to server www.radioeins.de[195.37.152.44]:80 ...
Cache size set to 320 KBytes
Connected to server: www.radioeins.de
Playing pnm://stream5.rbb-online.de/radioeins/sendungen/elektro_beats/miller_hour/20050302.ra.
Resolving stream5.rbb-online.de for AF_INET6...
Couldn't resolve name for AF_INET6: stream5.rbb-online.de
Resolving stream5.rbb-online.de for AF_INET...
Connecting to server stream5.rbb-online.de[195.37.152.51]:7070 ...
PNM:// fd=8
input_pnm: error while parsing headers.
input_pnm: failed to set up stream
Unable to open URL: pnm://stream5.rbb-online.de/radioeins/sendungen/elektro_beats/miller_hour/20050302.ra


Exiting... (End of file)

I do this having made the following preparations:
  • Real Player 10 installed
  • symbolic link to codecs in RP10 created at /Library/Application\ Support/ffmpegX/reallib
  • mplayer from ffmpegXbinaries230105.zip
Doing the same with some ram-files from amazon.de (containing besides the pnm-url another url of type rtsp) everthing works (almost...) as expected.

[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: bluehz on Mar 10, '05 09:29:07AM

Not sure if you tried this - but if you enter that URL in RealPlayer it asks to update to the Dolby 3 plugin. I did so, thinking that would resolve problem with mplayer - but it does not. Sorry.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: grau on Mar 10, '05 03:06:04PM

Yes, I entered the URL in Real Player. A download of some plug-in started (I don't remember, whether it was Dolb 3) and then it played.
And, yes, it didn't make mplayer play it.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: mrblue on Oct 03, '05 08:20:32AM

Try this, replace pnm with rtsp it should work.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: cepi on Feb 02, '05 09:47:17AM

Have anyone tryied this hit with 10.2.8?

I download the file lastbinary.sit (it was build on 2003 but is the last version that I was able to run on 10.2) and it is not even looking for the codecs at /Library/Application\ Support/ffmpegX/reallib and I am not evan capable to play my files.

Here is what I get as an output:

[jhe@Meztil Desktop]$ mplayer -playlist myfile.ram
MPlayer dev-CVS-030914-12:11-3.1 (C) 2000-2003 MPlayer Team

AltiVec found
Reading config file /usr/local/etc/mplayer/mplayer.conf: No such file or directory
Reading config file /Users/jhe/.mplayer/config
Reading /Users/jhe/.mplayer/codecs.conf: Can't open '/Users/jhe/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf
font: can't open file: /Users/jhe/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using usleep() timing
Can't open input config file /Users/jhe/.mplayer/input.conf: No such file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file or directory
Falling back on default (hardcoded) input config

Playing .RMF
File not found: '.RMF'
Failed to open .RMF

Exiting... (End of file)



[ Reply to This | # ]
update prebindings & reboot
Authored by: manos on Jul 09, '05 10:07:47PM

I had this problem until I updated the pre-bindings (I used YASU to do this step)...

I downloaded the latest Mac OS X build from http://www.mplayerhq.hu/homepage/index.html (note, they are taking some heat on patenting in the EU) (so you might want to download the source for your archives, too) ;-)

I thieved the mplayer.app from the package contents in the resource section of the package contents to the mplayer os x.app and stuck it in /usr/bin/local (they build it with static libraries, so all you need is the .app)...

put the links to the Real Player helix dna codecs (from the Real 10) in the ~/library/apllication support/... (see above) folder...

ran it and got those errors, so I ran YASU to update prebindings, restarted and it worked like a charm...



[ Reply to This | # ]
Do this easily with ffxmpeg
Authored by: SOX on Apr 27, '05 01:55:43AM

You can do this with a no-brainer GUI interface using ffxmpeg. Download a copy and install it (has dependencies but it's not hard).

Once installed run it. The gui will ask you to drag and drop a file onto it. If you try dragging the .wav file on it wont work since it will say unrecognized format.

Dont fret. instead drag and drop the file onto the text input for the open dialog. then in the quick presets select "audiofile to MP3". (if you watch closely you will note the output target file name appear in the other test box.) Press the ENCODE button.

Voila, it coverts it.

All this is actually obvious. the only "trick" is that for some reason the drag and drop gives an error message. But it works anyway.



[ Reply to This | # ]
Do this easily with ffxmpeg
Authored by: somynonami on May 24, '05 04:13:17PM

The article is about Real Audio, not .wav files. I tried this with Real Audio files too and it didn't work.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: ala on May 03, '05 02:09:29PM

this is excellent, just installed it on tiger and it works, although some errors regarding cook.so appear, but it does the job ;p

anyone knows how to automate this thing for a batch of files (say, a folder?)

also, does ANYONe have any idea how to download rtsp video streams (wmv) on os x?? on windows there are many (like SDP, or CocSoft Download) but none on mac!



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: emptypockets on Sep 17, '05 06:51:55PM

to download wmv streams on OS X try Cocoa JT
http://jeanmatthieu.free.fr/cocoajt/



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: thinweasel on Nov 07, '05 09:54:33AM
I was hoping someone might be able to help me decipher this error message. The file opens fine in RealPlayer and I have successfully opened some files with mplayer but I cannot get the files I want to open to open with mplayer.


 mplayer -playlist Bouncin.ram 
MPlayer dev-CVS-041116-19:27-3.3 (C) 2000-2004 MPlayer Team

AltiVec found
CPU: PowerPC
Reading config file /usr/local/etc/mplayer/mplayer.conf: No such file or directory
Reading config file /Users/aaroncoble/.mplayer/config
Reading /Users/aaroncoble/.mplayer/codecs.conf: Can't open '/Users/aaroncoble/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
font: can't open file: /Users/aaroncoble/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using Darwin accurate timing
Can't open input config file /Users/aaroncoble/.mplayer/input.conf: No such file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file or directory
Falling back on default (hardcoded) input config

Playing pnm://ra1.technoir.net/technoir/jazz/songs/rollini/bouncin.ra.
Resolving ra1.technoir.net for AF_INET6...
Couldn't resolve name for AF_INET6: ra1.technoir.net
Resolving ra1.technoir.net for AF_INET...
Connecting to server ra1.technoir.net[65.45.103.88]:7070 ...
PNM:// fd=9
input_pnm: error while parsing headers.
input_pnm: failed to set up stream
Unable to open URL: pnm://ra1.technoir.net/technoir/jazz/songs/rollini/bouncin.ra


Exiting... (End of file)

I thought this might be an issue with mplayer support of pnm. Any thoughts on this? Thanks!

[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: sridhargov on Mar 11, '06 04:19:29PM

Followed the instructions. Works great!! Thanks..



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: onkelringelhuth on Apr 06, '06 08:49:15AM
Should anybody care, this procedure contravenes RealPlayer's click-through license:

b) The Software may include certain plug-in or shared library components ("Plug-Ins"). You may only call to or otherwise use such Plug-Ins through the use of the RealPlayer application. Any direct use of Plug-Ins through a non-RN proprietary application, including a custom or user-written application, is prohibited by this Agreement.

Me? I probably don't care. Apart from anything else, the browser plugin that ships with RealPlayer arguably contravenes this clause.

[ Reply to This | # ]

sipr codec - Convert Real Audio files to MP3s
Authored by: EnigmaX on Apr 24, '06 08:37:00PM

After following the directions I get the following error messages after typing
[ra2mp3 tag01.ra tag01.mp3]
to try to convert a ra file labeled tag01.ra :

Error: dlopen(/usr/local/lib/codecs/sipr.so.6.0, 1): image not found
ERROR: Could not open required DirectShow codec sipr.so.6.0.
ADecoder preinit failed :(
ERROR: Could not open required DirectShow codec sipr3260.dll.
ADecoder preinit failed :(
Error: dlopen(/usr/local/lib/codecs/sipr.so.6.0, 1): image not found
ERROR: Could not open required DirectShow codec sipr.so.6.0.
ADecoder preinit failed :(
ERROR: Could not open required DirectShow codec sipr3260.dll.
ADecoder preinit failed :(
MPlayer dev-CVS-050703-10:29-4.0.0 (C) 2000-2005 MPlayer Team
AltiVec found
CPU: PowerPC

-aofile is deprecated. Use -ao pcm:file= instead.
Could not find "tag01.ra.wav".
rm: tag01.ra.wav: No such file or directory


Unless I'm mistaken the only problem is the sipr codec. There's a sipr bundle in the codecs folder which is from the realplayer codecs folder. I also tried using a sipr codec I downloaded from the net but that doesn't work either. If I can fix this problem I think the script should work fine. Any suggestions?

Please note:
* I'm running 10.4
* I have the latest mplayer and mencoder bin's
* I'm relatively new to terminal and the Unix environment. I'm learning as I go along, but step by step instructions would be appreciated.

Thanks.



[ Reply to This | # ]
Convert Real Audio files to MP3s
Authored by: drvk on Aug 23, '08 12:28:32PM

Hello,
I used your script with a little modification under Ubuntu.

#! /bin/bash
#
# Converts a Real Audio file to a mono MP3 and adds an ID3 tag.
#
# Usage: ra2mp3 infile [outfile]
#
author=`mplayer "$1" -vo null -ss 10:00:00 | grep author | sed -e 's/.*:\\s*\\($
title=`mplayer "$1" -vo null -ss 10:00:00 | grep name | sed -e 's/.*:\\s*\\(.*\$
mplayer "$1" -ao pcm:file="$1".wav -vc dummy -vo null
lame --preset extreme "$1".wav "$2" --tt "$title" --ta "$author"
rm "$1".wav


regards,
Daniel



[ Reply to This | # ]