Friday, February 16, 2007

VLC

At last, time to post something exciting!

VLC is a free and open source media player with streaming and transcoding capabilities.

Besides being an easy way to play nearly any video format, VLC's streaming capability makes it really easy to stream a video from one computer to another over the network. For a dvd quality video, you should be able to get away with a 54Mbit wireless connection, maybe less. You will also need a reasonably fast computer hosting the video, particularly if you are transcoding it. If you have a decent, wireless Pocket PC that might make a good client computer to watch your video on. So, now you're wondering how...

Step 1: download and install VLC from www.videolan.org for whatever operating system(s) you are using. I will be using Windows and Linux for this tutorial, but the idea is basically the same whatever you do.

Step 2: Open whatever it is you want to play or stream using the options in the file menu. The dialog that comes up should be pretty self explanatory pick your media, and check the save/stream box near the bottom. Then click the settings button next to the stream checkbox.



The next dialog allows you to choose protocol and transcoding settings. I recommend you check the "play locally" box and the "udp" box, because the udp protocol seems to work well. In the address box next to udp enter the ip address of the computer you are streaming to (in windows you can find it by typing ipconfig in a command prompt). If your original file is already in a reasonably compressed format you can skip down to setting up the client. Otherwise you need to pick a codec to use for recompression (so you don't need as much bandwidth). If you have a fast enough CPU i find mpeg4 works well, even over slow networks. Check out the screenshot below for settings to get you started. Experiment to find a good trade off between quality, bandwidth consumption and cpu usage. The bitrates you use will depend on the size of the video you are streaming and the codec you use. Smaller bitrates need less bandwidth to stream, but are lower quality.

If you are streaming though a router of some sort, you may need to increase the time to live (ttl) value.



After you pick some settings you like, click ok to both dialogs. Your clip should begin to play.

On your client computer, open up VLC and choose open network stream. Assuming you are following along with this tutorial, choose UDP/RTP and leave everything else at the default settings. Click OK and your video should start streaming.

I have simplified this process quite a bit. VLC is really quite powerful so I would recommend you look through the documentation on videolan.org or google it for some more tutorials. Hopefully everything made sense. Try it between two computers first, then experiment with any mobile devices you may have. If you have a something on your tv that can support streaming video, chances are VLC can stream to it. You will just need to setup the correct format and protocol.

Have fun, and feel free to leave questions in the comments.

No comments: