Categories:

# Streaming Video over VLC

VLC is one of those Open Source Projects that only gets about a tenth of its capability used by most people. What people often miss about VLC is its amazing streaming functions. Being the lazy fool that I am, I decided that it wasn’t enough to play my movies in one location in the house, I wanted them to be available everywhere, and I wanted to hit play and continue where I left off rather than start from scratch. Enter VLC.

If you’re one of those jammy beggars with a PocketPC, Sharp Zaurus or just want to be able to go to the toilet whilst your movies are playing and are too lazy to pause, read on. If you’re not, well, read on anyway…

The guide here is written with Windows in mind, but should work on OSX, Linux or any other supported Operating System. VLC, or VideoLan Client to give it it’s full name is a media player client that also streams, transcodes and makes cups of tea (I might be wrong about that last one). Playing media with VLC is easy. Just click file and Open your file, disc, directory or network stream and off you go.

Where it gets funky is the streaming element. Thankfully, the good folks at VideoLan have provided a Wizard for Windows users, which we’re going to ignore as it doesn’t do what we want. Instead, we’re going to set VLC up to use multiple streams for multiple devices.

Now whatever device you’re using is going to have a smaller screen than your standard media centre, so you’re going to have to scale down and possibly change algorithm. To do this, I’m going to transcode, reduce the width and height and stream it out. Launch VLC and from the menu go to Settings -> Add Interface -> Telnet Interface. This will start the telnet interface. The default password is admin, so don’t forget to change that if you’re serious about this. Now telnet in on port 4212 and log in. You should get a prompt prefixed with a greater than ‘>’ symbol. Now type the following in:

new channel1 broadcast enabled setup channel1 input X:\\path\to\my\file.avi setup channel1 output #duplicate{dst=std{access=http,mux=ts,url=:8080}} new channel2 broadcast enabled setup channel2 input X:\\path\to\my\file.avi setup channel2 output #transcode{vcodec=mp1v,vb=128,scale=0.5,acodec=mp3,ab=128,channels=2}:duplicate{dst=std{access=http,mux=mpeg1,url=:8081}} control channel1 play control channel2 play

Alternatively you can dump this to a file and type load file. This should start streaming the files. Now on your other systems, open up VLC and open a HTTP network stream pointing at yourhost:8080 – replace yourhost with the hostname or IP address of your system. This is the first stream which is the original. On your portable device, open up VLC and point it at yourhost:8081 – You should see a half-scale mpeg 1 version of the file.

Lets just have a quick look through that series of commands. First we create a new channel (channel1, although this could be called anything) and specify an AVI file as input. Mpeg files, DVD or TV Cards can be specified using DirectShow settings (dshow://) under Windows, or using the various methods described in the VideoLAN streaming howto under Linux, dependant upon your hardware.

After that, we define where and how the stream should be output. In our case, using http, multiplexed (mux’ed) into MPEG-2 TS format served locally over port 8080. The next 3 lines do the same for ‘channel2′, with some minor differences. Here, we transcode the stream into an MPEG1 format, at a bitrate of 128k/sec, scaled down to half size. Then we specify the where and how in pretty much the same way, except for the fact that it’s mpeg1 and on port 8081.

Of course, you can set these variables to anything you want, if your screen is good enough, you might want to set the video bitrate (vb) higher to 192 or 256.

This should work on Linux, OSX etc. but I haven’t tested it. What have your experiences streaming with VLC been like?

Posted in Guides, Microsoft, OpenSource.

## 0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK