Friday, April 6, 2007

How to download streams using mplayer

My first assumption is that you already have mplayer and mencoder and that you use Linux. Also, you need to know the source url of the media you want to download.

If you don't know about Linux, try searching for Ubuntu Linux and go from there.

This is a simple tip so it won't take long.

The command is as follows:

yoyar@lazyd0g:~$ mplayer -noframedrop \
> -dumpfile <name_of_the_file> \
> -dumpstream <url_of_the_stream>


Example:

yoyar@lazyd0g:~$ mplayer -noframedrop \
> -dumpfile /home/yoyar/Desktop/masters2.wmv \
> -dumpstream mms://some.broadcast.com

In this example, I'm downloading the mms (Windows Media) stream which I've specified via the -dumpstream switch. I've indicated where I want the output stored via the -dumpfile switch. The -noframedrop switch makes sure that the stream is continuous even if my internet connection is slow from time to time during the duration of the stream.

Later on, I can use mplayer to watch the video.

yoyar@lazyd0g:~$ mplayer /home/yoyar/Desktop/masters2.wmv

If you want, you can even start watching the stream via the wmv file before the stream has been completely downloaded but you should probably allow the download to proceed for several minutes before starting to watch the local copy since buffering won't work well. If you want buffered input, just watch the original stream.

2 comments:

Anonymous said...

You should try OS X as your primary machine. Believe it or not, I actually switched over.

Read about it here:
http://www.boranikolic.com/blog/2007/04/02/i-bought-a-mac-times-have-changed/

YO YO BEEEEHHHH!

DARWIN rules.

yoyar said...

Mac is nice and with a Linux-ish (BSD) back-end you should be able to take advantage of many programs such as mplayer. I like to hack Linux and its free so its the one for me.

I no longer have any need to run Windoze whatsoever.