Hack 90. Record a Streaming Video

 < Day Day Up > 

VCRs and PVRs have enabled us to record live video content. Using an application called VLC, you can do the same with streaming video.

You can't always sit and watch a streaming video from beginning to end. When the stream is live, this becomes a problem, because you can't pause the stream and have it start where you left off. Using VLC (http://www.videolan.org; free, open source) you can save the stream and watch it at your convenience.

8.2.1. Finding a Stream

Every streaming video has an Internet address associated with it. In order for VLC to locate the streaming video, you need the entire address. This address often begins with either rtp or rtsp and is formatted much like a web URL.

The complete address will most likely include the type of movie you are downloading as a file extension. For example, an address of rtsp://www.domain.com/some_movie.mp4 might be a complete address for a streaming video file named some_movie.mp4. Although not completely necessary, knowing the file extension will help you later in the process.

After you have the address for a streaming video, you'll need to configure VLC to open the stream and save it to your hard drive.

8.2.2. Opening a Stream

While running the VLC application, choose File Open Network Stream… (Windows) or File Open Network (Mac) to open a new window in which you can enter the necessary information for VLC to locate the streaming video. You will be opening a streaming video, so select the Network tab, if it isnt already selected.

First, select a protocol, depending on the address you are using. If the address starts with rtsp://, select the RTSP button. Then, enter the streaming video's address in the URL or Address text field. Although you might be able to enter the address without selecting a protocol, it might not always work. Figure 8-1 shows VLC being configured to open an RTSP stream from the address of rtsp://

Figure 8-1. VLC configured to open an RTSP video

Once you've entered the address, you need to configure VLC to save the stream to a file. To do so, check "Stream output" (Windows) or "Advanced output" (Mac). This will enable the Settings… button.

8.2.3. Saving a Stream

When you click the Settings… button, a new window opens, allowing you to configure how VLC handles the incoming video. Because you want to save the video, as opposed to relaying it, you need to click the File checkbox/button. If you would like to view the video while it is being saved to disk (and I recommend doing so), also click the Play locally checkbox.

To save the incoming video, you need to set a filename. Using the Browse… button allows you to navigate your hard drive and locate where you would like the video file to be saved, as well as provide a name for the file. A good approach is to simply name the file the same as it is named in the address. For example, if the file is named some_movie.mp4, name your saved movie some_ movie.mp4.

After setting the filename, select an encapsulation method that is compatible with the file format and codec of the streaming video. This can be a little tricky, so it will help if you are familiar with how to ascertain the file format from the file's extension [Hack #77]. Selecting the same type as the stream will ensure the best results. Figure 8-2 shows the available configuration options when using VLC.

When the configuration is complete, simply click OK and then click the OK button on the Open… window. VLC will proceed to process the stream and save it to your hard disk. If you have selected to "Play locally," the video will also play on screen.

8.2.4. Watching a Saved Stream

Watching a saved stream is exactly like watching any other video file. Depending on the configuration of your computer, VLC might not be the default application to open certain types of video files. If you find that a VLC saved file won't open in your preferred video player, try opening it using VLC. More often than not, it will open without any problems. Although other applications, such as Windows Media Player or Apple's QuickTime, can open some of the files you save, you will have the best results by opening VLC-created files using VLC.

Figure 8-2. Configuring how VLC to save a movie

     < Day Day Up > 

    Digital Video Hacks
    Digital Video Hacks: Tips & Tools for Shooting, Editing, and Sharing (OReillys Hacks Series)
    ISBN: 0596009461
    EAN: 2147483647
    Year: 2005
    Pages: 158
    Authors: Joshua Paul

    Similar book on Amazon

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net