Friday, March 27, 2009

Recording Live Video Streams

Online video can be rather frustrating to watch even with a broadband connection to the Internet. Too often, it's too choppy to be enjoyable.

I've already mentioned the script that I use to scrape the browser's cache for video files. But the real solution for off-line viewing is to download, or record, the streams to files.

One easy way of doing this is clive. It works with several video sites - I use it regularly to download video clips from youtube.com and google video. Highly recommended.

Some video clips, however, are more elusive. The major local news sites around here serve mms:// and rtsp:// streams (typically accessed via URLs linking to files with .asx extension). These streams can usually be recorded with MPlayer, like this:
mplayer -dumpstream -dumpfile video.wmv -nosound -vo null mms://www.example.com/path/to/video.wmv
or
mplayer -dumpstream -dumpfile video.wmv -nosound -vo null -playlist http://www.example.com/path/to/video.asx

The stream URL can be found in several ways, e.g. by inspecting the source code of the web page serving that video stream; or by sniffing out the URLs being accessed by the web browser.

What I am still looking for is a way to dump rtmp streams. If you know how to do it - please leave a comment!

2 comments:

  1. rtmpdump is the program you're after.

    I'm working on http://code.google.com/p/get-flash-videos/ which provides a front-end to it so you just need to give it the URL of the video, assuming it supports the site. (RTMP is little more complex than just needing a mms:// or rtsp:// URL).

    ReplyDelete
  2. I've spotted rtmpdump before, but it seemed to support BBC and hulu only.

    Looking at your project, I see that I was wrong - I'll give it a try soon.

    Thanks a bunch!

    ReplyDelete