Archive for the ‘mplayer’ Category

More mplayer fun!

This week I have been playing with youtube videos to either extract the sound from the video and converting to MP3 or converting the whole video to mpeg.

I’ve used the same kind of process to convert RealAudio streams to MP3. Firstly download the youtube video. I use the DownloadHelper addon for firefox. It’s really easy to use, you just search for your favourite video then click the button in the toolbar.

Once you’ve got your flv, you should be able to play that through totem/mplayer. If not, you’ll need install the correct gstreamer plugins. If you’re using Fedora, I’d suggest taking a look at MyGuide

OK, let’s say we want to rip the sound out of the file.. Really useful if you want a obsecure song that you can only find on youtube. It’s a two stage process, rip it as a wav then encode it to mp3.

mplayer Pork_and_Beans.flv -ao pcm:file=file.wav -vc dummy -vo null
lame -V Pork_and_Beans.mp3 file.wav --tt "Pork and Beans --ta "Weezer"
rm file.wav

That’s all there is to it!

OK next trick is to convert the flv to a Mpeg. This is slightly tricker and I haven’t had great results playing these on Windows (timing are all screwy)

mencoder Pork_and_Beans.flv -oac lavc -ovc lavc -lavcopts vcodec=msmpeg4v2:acodec=libmp3lame:abitrate=64 -o Pork_and_Beans.avi 2>/dev/null

The /dev/null is to drop the millions of warning messages you get about clipping.

Extreme ASCII Art

LibcacaWhilst procrastinating over yet another dead line, I thought I’d have a play with libcaca, the completely useless yet completely brilliant Colour AsCii Art library. libcaca is a graphics library that output text rather than images. The genius part of it is that you can use it as a video output in mplayer and display all your wonderful HD videos as text!

I always love stuff like this. You can see how much work as gone even though it’s a complete waste of time. It’s a similar idea to NetQoS‘ Network management display which again is great but completely useless. Check that out here http://www.techcrunch.com/2007/04/10/watch-your-network-play-space-invaders/

Recording RealAudio streams and converting them to MP3

A friend of mine recently had his 5 minutes of fame of Five Live and asked me to if I could covert the “Listen again” to an mp3 so it could be saved for the good of Humanity. Here how I did it:

  1. Finding the name of the stream can sometime be a bit tricky. If you can get it to play in the stand alone RealPlayer then you can just click on File->Clip properties->Clip source. This will then bizzarely open a webpage. You looking for an address like rtsp://rmv8.bbc.net.uk/radio5/anita_mon.ra. If you can’t open it then it’s a case of looking though the source of the page.
  2. Now you’ve got the address, run the following command:mplayer -noframedrop -dumpfile file.rm -dumpstream rtsp://rmv8.bbc.net.uk/radio5/anita_mon.ra
    This will save the clip as file.rm. Watch out though, this is recorded in real time. So a 3 hour radio show will take… 3 Hours!
  3. Next you need to covert the realmedia file to wav, again mplayer is your friend mplayer file.rm -ao pcm:file=file.wav -vc dummy -vo null
  4. Last stage is to convert from wav to mp3 using lame. I like to hedge my bets and encode it as VBRlame -V file.mp3 file.wav --tt "Title" --ta "author"

You should have have a shiny MP3 file for your troubles.

Return top