Streaming with VLC
VLC can stream theora files to an Icecast2 streaming server. This works with VLC 0.9.4 and above on Ubuntu, and also on earlier versions of VLC on Windows (although the process is different for earlier releases of VLC). It is possible to stream video files from your computer, a live webcam or hand held camera. If you have a laptop with a camera built-in then you can also send live streams using this.
If you are using Ubuntu it is better to upgrade your version of Ubuntu to Intrepid (8.10) or Jaunty (9.04) as they both come with a version of VLC which is easy to stream with. If you don't wish to upgrade the Operating System then you need to install the latest version of VLC from source files - be warned, upgrading VLC from sources is complex.
Streaming Server Requirements
We will examine streaming to an Icecast Server. You need access either to an Icecast Server or to someone who can create an account for you and provide the access details. You need to know the following information about the Icecast Server:
- Hostname or IP Number of the Icecast Server
- Port (Default is 8000)
- Username (This may not be necessary depending on how Icecast is configured.)
- Mountpoint (This may not be necessary depending on how Icecast is configured.)
Choosing Video File to Stream
Lets look at streaming using the camera built into a laptop. The process is very similar for streaming from an external camera or archived video files.
The first thing you need to do is open VLC. Now from the Media menu choose Streaming... :
This will open a panel where you can choose the source for the video stream.
We will choose the last tab - Capture Device, however here you could also choose any of the other tabs to stream video from a disc (a DVD for example), archived files, or relay an incoming video stream. The capture device window looks like this :
If all works well you might not need to change any settings in this section at all. Instead you just click on the button titled Stream.
Under the Outputs section of the stream settings there is a section for configuring Icecast.
You just need to check the box here and then fill in the details. There are a few things to remember here :
- The Mountpoint should always start with a '/'.
- The address does not start with 'http://'.
- Most often you do not get a username for Icecast. In this case use the username 'source'.
- The port is almost always 8000.
- The format for the Login:pass field is exactly as the title suggests - the login followed by a ':' and then the pass. All with no spaces. For example, a stream to a default install of Icecast2 (the default passord is always 'letmein') would be :
As you enter the information you will see the text change in the 'Generated stream output field' at the bottom of the window.
If you were experienced you might be able to directly type this information in without using the fields provided, but it's far easier to just to fill in the boxes as required.
Now all you have to do is press 'Stream' and the live stream will be sent to the Icecast2 server. However, VLC does not provide good error feedback, so it might sit their looking like it's happily streaming whereas in fact nothing is happening. VLC might even display 'Streaming' in the status bar, but this means nothing!
The only way to know it is actually working is to look at the status page on your Icecast server, or use a video player to playback the stream live from the server.