Advertisment

Video Streaming on your Network

author-image
PANKAJ
New Update

VideoLan Client or VLC can play a number of audio and video formats, such as MP3, Ogg-Vorbis, DVDs, VCDs and

DivX.

Advertisment

But, that doesn't mean that it ends up being a simple desktop media player. It can also be used to stream video across a network. Hence, it can be used as a streaming server as well as a client, making its name, VidoLan Client, a misnomer.

VLC is a media player that can play

multiple
audio/video formats, can stream video and is available for Windows as well as Linux

We'll first install VLC on Windows and PCQLinux 8.0 and then set it up to stream. 

Advertisment

Install software 



You'll find the software on this month's PCQ Essential CD as a zip named vlc-0.5.1-win32.zip. To install it on Windows, extract it to a directory on your hard disk (say vlc), and run vlc.exe from there. This will show up the graphical media player. 



To install it on PCQLinux 8.0, mount the CD and change to the directory system/cdrom/unltdoss/ linux/videolan. Install all the RPMs found in this directory by issuing the following command:

rpm —ivh * -nodeps

Launch X Window and open a terminal window within X. Issue the following:

Advertisment

vlc

This will show up the graphical media player. 

Stream video



Select a machine on your network that is running Windows or PCQLinux 8.0, as the server. Install VLC on it. Both Windows and Linux versions of VLC can stream video contents over a network. 

Advertisment
Multicasting
Using unicast, video contents can be communicated to a single machine on a network-a peer-to-peer communication. For such communication, you need to specify the exact IP address of the target machine.



With broadcast, content is communicated to all the machines on the network. All machines receive the content even if they don't intend to. Such content is delivered using broadcast address for a network. For example, the broadcast address for a 192.168.1.0 network is 192.168.1.255. 


For video streaming, neither unicast nor broadcast may be suitable. You may not want to stream video to only one machine. You may like more than one machine to receive the video stream so that more users can watch the video. If you opt for broadcast, you may end up wasting network bandwidth by streaming heavy content like video to all machines and hence to users who might not be interested in watching the video.


This is where Multicast comes to the rescue. In multicast, the server streams the content to a particular IP in the range of 224.0.0.0 to 239.255.255.255. This IP does not fall in the range of the prescribed IP addresses for computer networks. Hence, content delivered to this IP is not received by any machine on the network. Only when a machine connects to this IP, will it be able to retrieve the content and more than one machine can connect to a multicast IP simultaneously. 


As you will notice in this article, we specify a multicast IP address (224.0.0.1) while setting up the VLC on the server to stream and while setting up VLC on the clients to display the streamed content. 


To stream from the Windows machine, launch VLC. Click on File>Stream Output. Select UDP and fill in the IP address 224.0.0.1 (see box on multicasting) for 'Address'. Leave the Port to its default. Click on OK. Next, select the video content you want to stream. If you want to stream a video file like DixX or MPEG, click on File>Open File, browse and select the file to stream. If you want to stream a DVD or VCD, click on File>Open Disc. According to the media type, for the Disc Type select DVD or VCD. For the device name enter the drive letter (say D:) of your DVD ROM or CD-ROM drive. Click on OK. (To set-up VLC on clients for displaying the streamed content, read Watch the stream.)

To stream from the PCQLinux machine, launch VLC and click on File>Network Stream. Click on the checkbox, 'Stream Output' and then on the Settings button. Select UDP and fill in the IP address 224.0.0.1 (see box on multicasting) for 'Address'. Leave the Port to its default. Click on OK. In the Open Stream window, click on OK again. 

Advertisment

Next, to stream content in a file like DixX or MPEG, click on File>Open File. Click on the File tab and then on the browse button. Select the video file to stream. If you want to stream a DVD or VCD, click on the Disc tab. According to the media type, select DVD or VCD for the Disc Type. For the device name, enter the device filename corresponding to your CD/DVD drive-usually /dev/cdrom. Note that when you select DVD, the device name changes to /dev/dvd. You must change it to /dev/cdrom because the device file name for DVD drives is also /dev/cdrom in PCQLinux 8.0. Click on OK. 

Watch streaming video



Install and launch VLC on the client machine(s). On Windows machines, click on the button labeled Net on the panel of the player. Select UDP/RTP Multicast and fill in the same IP address as in the case of the server-224.0.0.1. Click on OK. You should now be able to see the streamed video. 

On machines running 



PCQLinux 8.0, click on the Net button on the panel of the player. Click on the Network tab. Select UDP/RTP Multicast and fill in the same IP address as in the case of the server-224.0.0.1. Click on OK. 

Advertisment

HTTP streaming



VLC can also display video content streamed over HTTP. That is, it can display a video file hosted on a Web server while retrieving/downloading it. In this case, you don't need to run VLC, but a Web server, on the server machine. If the server machine is running Win 2000/XP, you can use IIS Web server. If the server machine is running 

PCQLinux 8.0, you can use Apache Web server. You simply need to put the video files in the 'document root' directory (or in one of its subdirectories) of the Web server. The document root in case of IIS is c:\Inetpub\wwwroot (assuming that Windows is installed in C:) and /var/www/html in the case of Apache. If you want to stream a VCD, you can copy the .DAT files found in a directory named MPEGAV on the VCD to the document root. In the case of a DVD, convert the DVD into DivX and host the DivX file in the document root. 

To view the video file on the Web server, launch VLC on the client machine. Click on the Net button. Select the option HTTP/FTP/MMS. Fill in the URL in the following form:

Advertisment

http:///video-filename

For example, if the Web server is running on a machine with IP 192.168.1.1 and the name of the video file is movie.avi, then the URL will be:http://192.168.1.1/movie.avi

VLC was not very stable while streaming DVD contents and it was not able to play some DivX files. This may be because VLC is still in its infancy-version 0.5.2. Nevertheless, video streaming works out of box in VLC and it is also an elegant media player. For more on VideoLan project and VideoLan Client, check out www.video lan.org. 

Related Articles

Stream TV Channels on the Network

Video Streaming in Linux

Advertisment