MPlayer/Rip streams
From Gentoo Linux Wiki
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
Contents |
[edit] Introduction
The aim of this howto is to rip (i.e. save on the hard disk) audio/video streams using MPlayer.
MPlayer can handle most of the streaming formats that are used on the Internet: Real Media, Windows Media and Quicktime are the most important ones.
[edit] Codecs
[edit] Quicktime
If you want the support for Quicktime movies, compile MPlayer with the win32codecs USE flag, then issue the following command:
# emerge -pv mplayer
and check that the win32codecs package is going to be compiled with the quicktime USE flag.
[edit] Real Media
Real Media codecs are provided by two different packages: realplayer and win32codecs. By default, realplayer's ones are used due to security issues with the latter, but in my experience some streams can be correctly played only if you use win32codecs. The default behaviour can be eventually changed with a little tweak, which anyway makes things slightly more difficult. So, if you really care about security proceed with the default way, otherwise carry on with the alternative way.
[edit] Default way
This is the easiest way, as you only need to compile MPlayer with the real USE flag. Portage will install realplayer as a required dependency. Codecs will be installed in /opt/RealPlayer/codecs/ directory.
[edit] Alternative way
We need to tweak MPlayer's ebuild. Before proceeding, let's copy it and some other required files to the overlay directory. In this example, we'll assume your PORTDIR_OVERLAY is set to /usr/local/portage.
If you don't know what an overlay is or you don't have it yet, please read this howto.
# mkdir -p /usr/local/portage/media-video/mplayer # cd /usr/local/portage/media-video/mplayer # cp -R /usr/portage/media-video/mplayer/files . # cp /usr/portage/media-video/mplayer/mplayer-1.0.20060415.ebuild .
Now open /usr/portage/media-video/mplayer/mplayer-1.0.20060415.ebuild with your favourite editor.
| File: /usr/portage/media-video/mplayer/mplayer-1.0.20060415.ebuild |
|
We don't need realplayer, so comment it out: #x86? ( real? ( >=media-video/realplayer-10.0.3 ) ) MPlayer should look for win32codecs, not for those provided by realplayer:
pkg_setup() {
if use real && use x86; then
#REALLIBDIR="/opt/RealPlayer/codecs"
REALLIBDIR="/usr/lib/win32"
fi
}
|
Finally, create the digest file:
# ebuild mplayer-1.0.20060415.ebuild digest
Before emerging MPlayer, make sure it will be compiled with the win32codecs and real USE flags. You have to enable the real USE flag for win32codecs package, too.
[edit] Live.com
Since some streams need Live.com support, it is recommended that you compile MPlayer with the live USE flag, otherwise you may get an error like this:
Playing rtsp://realserver.kataweb.it/katanew/news_ansa/1099310401142_Mondo_20041101125647_low.rm. Resolving realserver.kataweb.it for AF_INET... Couldn't resolve name for AF_INET: realserver.kataweb.it Not a Realmedia rtsp url. Trying standard rtsp protocol. RTSP support requires the "LIVE.COM Streaming Media" libraries! Unable to open URL: rtsp://realserver.kataweb.it/katanew/news_ansa/1099310401142_Mondo_20041101125647_low.rm
| FIXME: rtsp://realserver.kataweb.it/katanew/news_ansa/1099310401142_Mondo_20041101125647_low.rm doesn't exist any more. Find another test movie.
rtsp://a1223.v26085d.c25708.g.vm.akamaistream.net/7/1223/26085/v0001/media2.dayportmsp.com/ccn1d/0044/21590020051205_002656p7003041p5.wmv Could be a good test movie. |
[edit] Installation
This is simple:
# emerge -av mplayer
[edit] Testing
The best way to see if everything went well is to play some movies before trying to rip them. All you need is to find the URLs of some streams and launch them with MPlayer:
$ mplayer "<url>"
If you have problems you can try to add the -playlist option:
$ mplayer -playlist "<url>"
If you still can't view your video, try to use wget and cat commands. For example:
$ wget "http://www.br-online.de/cgi-bin/ravi?v=alpha/centauri/v/&g2=1&f=041027.rm" $ cat "ravi?v=alpha%2Fcentauri%2Fv%2F&g2=1&f=041027.rm"
This will show you:
| Code: $ cat "ravi?v=alpha%2Fcentauri%2Fv%2F&g2=1&f=041027.rm" |
rtsp://ravi.br-online.de:5050/ravi/alpha/centauri/v/041027.rm --stop-- pnm://ravi.br-online.de/ravi/alpha/centauri/v/041027.rm |
Grab the first URL and play it with MPlayer:
$ mplayer rtsp://ravi.br-online.de:5050/ravi/alpha/centauri/v/041027.rm
[edit] Working streams
| Note: Some of the following streams require mplayer to be compiled with the aac USE flag. |
The following streams are known to work with MPlayer:
[edit] Real Media
- rtsp://ravi.br-online.de:5050/ravi/alpha/centauri/v/041027.rm
- http://pdl.warnerbros.com/wbol/us/whv/med/matrix/collection/ultimate_matrix_collection_sizzle_tlr_100.rm
- rtsp://a157.v59133.c5913.g.vr.akamaistream.net/ondemand/7/157/5913/418966df/whitehouse.download.akamai.com/5913/20041103-3.v.rm
- rtsp://real.nasa-global.speedera.net/real.nasa-global/ascan_2004/hq_050604_spacedays.rm
- rtsp://a1496.v78706.c7870.g.vr.akamaistream.net/ondemand/7/1496/7870/v0001/mitstorage.download.akamai.com/7870/8/8.03/f04/video/ocw-8.03-lec-mit-30sep2004-0007-220k.rm
- rtsp://rmlivev8.bbc.net.uk/farm/*/ev7/live24/worldservice/livenews_v8.ra
- rtsp://137.78.25.101:554/Video-Galileo-AVC-2003-182.rm
The following movies works if you add the -playlist option:
- http://www.dreamworks.com/trailers/island/island_trlr3_rm_750.ram
- http://www.ifilm.com/RealPlaylist?l=-2087040320&ifilmId=2669030&bandwidth=300
- http://www.kusc.org/streams/kusc96.ram
- http://play.rbn.com/?url=nfl/nfl/open/packers/demand/TrainingCamp05/050805sherman_300.rm&proto=rtsp
[edit] Quicktime
- http://movies.apple.com/movies/newline/blade_trinity/blade_trinity-tlr2_240.mov
- http://moviesaskew.com/movies2/par.mov
- http://www.the-mario-opera.com/mariopera_high.mov
- http://images.apple.com/movies/us/hd_gallery/gl1800/480p/the_brothers_grimm_m480pa.mov
[edit] Windows Media
- http://www.penguinbomb.com/omniscaper/WIPS/trench.wmv
- mms://vip1.yacast.fr/encodereurope1
the following work with the -playlist option:
- http://www.camstreams.com/asx.asp?user=gb3hv
- http://www.camstreams.com/asx.asp?user=gb3bh
- any other http://www.camstreams.com stream
[edit] Problematic streams
Unfortunately there are some movies we can't display correctly:
- pnm://a1496.v78706.c7870.g.vr.akamaistream.net/ondemand/7/1496/7870/v0001/mitstorage.download.akamai.com/7870/8/8.03/f04/video/ocw-8.03-lec-mit-30sep2004-0007-220k.rm
- pnm://rm.bbc.net.uk/news/media/video/39688000/rm/_39688671_leeds23_gilmore_vi.rm
For the MIT OpenCourseWare videos, there are instructions for downloading them on this page: [1]
Sometimes it helps to replace "pnm://" with "rtsp://" and play it.
Please edit this howto if you know how to play any of them.
[edit] Ripping
$ mplayer -noframedrop -dumpstream "<url>" -dumpfile <file>
or
$ mplayer -playlist "<url>" -dumpstream -dumpfile <file>
[edit] Playing
If when trying to play a ripped RealAudio file MPlayer exits with the following error message:
Playing .RMF. File not found: '.RMF' Failed to open .RMF
create a text file called <rippedfile>.ram with the location of the ripped file (<rippedfile>.rm) as content:
| File: <rippedfile>.ram |
rippedfile.rm |
If all fails, you could try downloading directly the file to you PC and the playing it with mplayer.
[edit] Useful links
From MPlayer's homepage:
From Gentoo Wiki:
From Gentoo Discussion Forums:
- Streaming Media (HOW-TO)
- Mplayer without realplayer
- How to make mplayer play realmedia files, without realplayer
Others:
- Easy way to extract video stream links from ifilm, google video, youtube and many others
- Firefox extension for extracting stream links from youtube, ifilm etc.
- HOWTO connect to Ffmpeg, QuickTime, Icecast, Ogg/Vorbis and Icecast Theora streams from Linux, Mac and Windows
- NPR show streaming
- RealAudio and RealVideo Test Clips
- OpenQuickTime - Test Movies
- RTSP/RTP streaming support for MPlayer
- Live Media Streaming Libary
- All Streaming Media
- Capture streaming video and audio (record streaming media)
- Listening to and recording audio and video streams with MPlayer
- Scheduling Stream Recording on Linux
