Saturday, June 17, 2006

How to Rip Streaming Video

In many instances you might see a video streaming on a website that you want to download for whatever reason. For example, I download videos off news broadcast sites sometimes so I can take a few screencaps of it to throw in my blog articles to make it look better, since it's always good to have some images in an article. I also often upload the video to a separate site where users can view it directly without having to view an ad first or going through the site and looking for it (if they didn't post a direct link or something).

However, most sites who stream the video don't want you to download the video onto your hard drive into a format where you can edit it and such, so they encode it with ActiveX or Javascript in an attempt to stifle people from saving it. The question of whether or not this is legal probably has to do with copyright laws, but if you're not claiming the material as your own and linking back to their site I don't see how it would be a problem. It might even be more practical for them as it saves them bandwidth since you are hosting the file for them on another service, instead of forcing them to serve it up.

But, there is a way you can capture any (I haven't come across one where I haven't been able to yet) video with a few tools. These tools do cost money and I haven't come across any freeware equivalent of them yet, but they are good and cheap for what they do, so I think it's a good value and they are extremely easy to use. The two tools I will be talking about today are StreamingStar's URL Helper and HiDownload. In addition to being able to rip streaming video, they should also allow you to do the same for most streaming audio, although some audio can have DRM encryption which prevents you from editing them in the same way as video formats.

URL Helper is a network sniffer that runs with WinPcap to listen to all incoming traffic on your network card and allows you to see how the video file is being sent to you. When it is set up correctly it will show you only the packets that are coming over the network that are URLs and protocols which stream audio and video. Once you see the file you're looking for you can simply right click on it and choose "Download with HiDownload" (it's sister software companion). HiDownload is a tool that allows you to download from protocols such as RTSP and MMS which are commonly used to broadcast streaming video in programs such as Windows Media Player and Real Player.

So now I am going to show you how to setup these programs to catch a video and download it onto your hard drive. The first steps are obviously to install URLHelper and HiDownload. HiDownload doesn't require much configuration, but in some instances it might, depending on the server you're downloading from. URLHelper is a bit different and took me a bit of tweaking to get right. Some network cards work differently from others and require different filters to get it to see the streams just right, but I will show you essentially what you want to do to grab the video and hopefully it should work for you. So, let's find a video to get. I'll pick one from a local news station, wfaa.com.

Like most news stations that broadcast a streaming video clip of a news bit, it often times requires Internet Explorer to play, so we'll be using that to load up the page. First, we'll open up URLHelper and have a look at the options. After installing URLHelper, it will prompt you to install WinPcap if you don't already have it, so you want to install that to, as that is the engine it uses to sniff the network for the packets.

When you first open URLHelper you have a few simple choices at the top, the first being "Select Adapter". I have two choices, a Dialup adapter and my network card. Obviously, since I'm on DSL and not dialup, my network card is the adapter I want to select.


The next place you want to go into is "Options". Under options you have several modes in which the program will listen to traffic. Normally you should do fine with auto-select, but on some machines you may have to choose promiscuous and on some you may have to choose All Broadcast Packets and check the box at the top to "Capture All URLs". So, you may have to play with the settings a bit in order for it to catch the video right. What you will essentially do to find the right mode is keep going back, in your browser, to the page that the streaming video is being played and try to play the video. You should be able to see it show up as a link in URLHelper once you're sniffing the packets which I'll show you next.

Once you have your options set you want to start listening to network traffic and see if you can catch the video. So, you will select "Sniff Network". If you're browsing around other sites you should immediately begin to see URLs show up in the window frame. Just visit any websites and they should show up, along with all the URLs it downloads within that page. If nothing is showing up, something is wrong and you need to go back and fix this. Even if you're doing nothing (ie: your computer is sitting idle - not surfing), often you will see some traffic, such as from Google Toolbar for example, which checks a pages pagerank if you have it set to do so and so forth. But, let's go back to trying to find the video.

We're on the website wfaa.com right now and we'll just pick a story with a video in it and see if we can capture it. Just at random I found a story about a hit and run driver that has a video with it.

Free Image Hosting at www.ImageShack.us

Close up of the video link:

Just clicking on the page, we should already see a lot of links showing up in URLHelper. As you can see, it's nothing really special, just links within the web site to graphics, ads, Google Toolbar queries and that kind of thing, so now let's try and spot the video!

Free Image Hosting at www.ImageShack.us


I click to play the link and open up the embedded player to watch the broadcast about the story. As soon as I do, a popup window opens with an embedded WMP starts. First, it plays an ad for a local car dealership. As you can see, the screenshot I posted has a blank frame where the video is playing, even though on my screen I see a car. This is specifically designed this way so you cannot take a screenshot of the video that's playing in the player (which is one of our original purposes).



So, we wait until after the ad is played and then watch the video and click back to URLHelper to see if it's captured the stream. And now just shortly after starting the video, the link has appeared in URLHelper. So, I can pause the broadcast and simply download it now with HiDownload.

Image Hosted by ImageShack.us

You can tell this, obviously, because it's the only file with the extension WMV listed in the URLs. Now I can start the download in HiDownload and stop URLHelper from sniffing the network.

Under Download Mode, there are several options. General File Download will work most of the times, however, sometimes you need to drop the list down and change it to Windows Media Stream or one of the other types of formats that you're trying to capture. This "spoofs" to the host that it is actually the player trying to download the file and not a separate program. For some reason, HiDownload was giving me a lot of problems and wasn't downloading the file. The file was simply streamed from an HTTP protocol so I should have been able it with even a downloading program, like FreeDownloadManager. But, it seemed to be picky and wanted it to say it was coming from Windows Media Player, so I had to do that in order to fully download the file. The download hung a few times, so I finally just shut everything down and restarted, opened HiDownload back up and it downloaded perfectly. Probably just some silly Windows error causing it, but a restart is always the first thing to try when there is any kind of problem on your system.


The graphic above is simply a small picture showing that the file is being downloaded.

So now that we have the file, how to take screencaps from it? I use a very nice program called Image Grabber II. It comes in two flavors now, the old version and one built with .NET which is much nicer. So, we can open the file in Image Grabber II and take screen shots of the file very simply. Just use the little camera icon in the bottom to click when you want a shot and then go to file and 'Save Individual Files' and choose a folder. You'll end up with a nice screen shot that is in a small size that fits perfectly into a blog.


If you need to change the dimensions or do some minor cropping, you can use a free tool such as IrfanView, which works very well for this purpose and is freeware, to do so.


If you need to do advanced editing, you will probably want to use something like Photoshop or it's freeware equivalent, GimpShop.

But what about the video, what if you want to convert it to another format? There are many tools for this, such as VirtualDub or paid products, such as BoilSofts, which has many easy to use joiners, splitters, and editors for most popular formats. There is also WinAVI which is a tool that will convert just about any video format to another. But, that is another article.

UPDATE 6/19: I found a couple video editors & convertors that are freeware and open source. They are good and look pretty easy to use, although I haven't thoroughly played with them enough to know.

The video editing software is called Jashaka and seems to be a replacement for types of video editors such as Adobe Premier. The other program is MediaCoder and it can convert just about any type of audio and video into any other type. Most open & closed source formats are build in, and you can download the encoders for Realmedia and Windowsmedia types.

Once you have the video downloaded, you can upload it to a site such as youtube, zippyvideos, or videoegg (which I believe has unlimited storage). I primarily use Zippy.

Well, I hope that helped you in your quest to capture a streaming video. If you liked the article or have any questions or comments, feel free to post them. In upcoming articles I might describe some other methods I use to capture video, such as how to capture it from Youtube, or using simple Firefox plugins. There are also some tools to capture audio which I can discuss as well. So start downloading and good luck!

2 comments:

Anonymous said...

Great article! I always wondered how to do this and those 2 tools worked perfect and are very easy to use.

"In upcoming articles I might describe some other methods I use to capture video, such as how to capture it from Youtube, or using simple Firefox plugins"

I would be very interested in that, please do it :)

Free PS3/Wii said...

Great post!

If I ever need to get videos, I just look through my temp files and it was there. I would try this format sometime if I need a video online.

Thanks!

ps. You shoud write such posts in a word doc too so we can download it for later reference ;)

Related Posts with Thumbnails

Addthis