Justin Loh\’s Tech Blog

June 7, 2007

VideoLan – VLC Media Player and Streaming Server

Filed under: Media Streaming — jusloh @ 7:37 am

VLC Media Player and Streaming Server is an excellent open-source freeware.

VLC media player is a highly portable multimedia player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, …) as well as DVDs, VCDs, and various streaming protocols. It can also be used as a server to stream in unicast or multicast in IPv4 or IPv6 on a high-bandwidth network.

How-To: Stream almost anything using VLC

The VLC media player is an amazing piece of software. In its most basic form it is a lightweight media player that can play almost any audio or video format you throw at it. VLC is also multiplatform in the most extreme sense of the word; it can run on Windows, OSX, Linux and PocketPC / WinCE handhelds along with other systems. VLC works great as a streaming server and video transcoder too.

Eliot Phillips used VLC to move Tivo recordings to an iPod before, but this guide is going to show you how to stream any type of media file from your computer to another device on your network. We will also demonstrate how to remotely control VLC using any web browser. Using these techniques you could stream video from your office computer to a laptop plugged into the living room TV and control the playlist with your PDA.

The first thing you need to do is grab a copy of VLC media player for your platform. We are going to be streaming from a Windows machine to a Linux machine, but the interface is almost identical no matter what you are using.

Once you install VLC and start the program you will be greeted by this lightweight frontend.

vlc1

Click “File > Open File” to bring up the “Open” dialog box.

vlc2

Click on the “Browse” button to bring up a standard Windows file selection box. Select the file you want to play. Then click “Open”. We�ve selected multiple files so VLC will build a playlist.

vlc3

Your selection should appear in the text box next to the “Browse” button. Click the checkbox for “Stream Output” and then click the button “Settings.”

vlc4

Check the box next to “Play Locally” under “Output Methods.” When streaming to another system you don�t have to play the file on the server, but we will use this option to visually confirm that our video is playing properly before trying to access the stream from another computer.

Check the box marked “UDP” and type in the IP address of the computer you want to stream the file to. Then click “OK”. The file is ready to play so click “OK” in the “Open” dialog box too.

[Added by Justin Loh: This step did not work with my .flv video. Though the server was playing the video locally, the client (localhost:8181) did not play the video. Corrective action was to uncheck “UDP” checkbox” (this could be because my UDP transport protocol was not working on my laptop or MPEG-TS was not a corrective format container for streaming. MPEG-TS was the only format container or encapsulation method available when “UDP” is selected) and click “HTTP” checkbox, then set “Address” as 127.0.0.1 and port as “8181”. Now select “ASF” as the encapsulation method and keep the rest of the “Stream output” dialog defaults. Click “OK” to go bakc to the “Open” dialog box and then click “OK” in the “Open” dialog box to start playing the video.]

vlc5

The video or audio file should begin playing on the computer. The last thing to do before switching to your second computer is to turn on VLC’s web interface by clicking “Settings > Add Interface > Web Interface”.

vlc6

Open VLC on your second machine. We are using a Linux machine.

[Added by Justin Loh: As I am testing on the same laptop, I open another instance of VLC media player as a client.]

vlc7

Click on “File > Open Network Stream”. UDP is already selected so you just need to click the “OK” button and VLC will start playing your stream.

[Added by Justin Loh: As mentioned earlier UDP transport protocol did not work on my laptop so we are going to use HTTP transport protocol instead. In the “Open Network Stream” dialog, select “HTTP/HTTPS/FTP/MMS” radio button. Type in the text field box “127.0.0.1:8181” and then click “OK” button. VLC will take a moment to start playing your stream.]

vlc8

Now that the stream is successfully playing on your computer you can open up a web browser to control VLC remotely. Type “http://:8080/” into the address bar. The web browser will present you with all of the controls you need to manage playlists and playback remotely.

[Added by Justin Loh: In my web browser, I type in “http://localhost:8080” in the URL address field. The web interface displayed showed the selected files available on the VLC Streaming Server for streaming. Clicking on the different files on the web interface changed the video on the VLC Streaming Server video played. At the same time, after a moment or two, the client VLC media player changed respectively.

Observed Annormalies:

  1. When I put the VLC Streaming Server on loop playing mode, the VLC client would still stopped after playing one video. Clicking the play button of the VLC client to restart seemed to cause the port 8181 to be blocked after one or few video files and return a “unable to open 127.0.0.1:8181” message. Once the port is “stucked”, you need to clear the instance of VLC client using Task Manager and end the process. This is tricky because there were two VLC process. One for the Stream Server and the other is the older VLC client. Restarting a new VLC client on “127.0.0.1:8181” played well after that until the next port “blockage”.
  2. I did not notice this at first because the Streaming Server was playing locally. After I turned off the “Play locally” option on the Streaming Server and played the VLC client, the audio was off while the video was on. I suspect that when VLC Streaming Server is played, it “grabbed” the default audio IRQ port. Since the VLC client is also a similar instance with the same default audio IRQ port, the sound did not play out in the VLC client. At the time of this writing, I was not able to change the audio IRQ port setting on the VLC client instance.]

2 Comments »

  1. A very Nice Website Ive seen Uptill. Excellent post. Keep it up! Good day!

    Comment by Syed Shani — January 4, 2009 @ 7:10 am | Reply

  2. Hi,

    The new version 1.0.0 is bug laden! crashes all the time!!!
    going back to 0.9.9! It is alot more stable.

    Comment by gk — July 26, 2009 @ 4:34 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a comment

Create a free website or blog at WordPress.com.