Stream of the World Cup 2010

This year I wanted to stream the FIFA World Cup 2010 (or Weltmeisterschaft 2010 here in Germany :)) to a few computers at my work. I chose VLC to do this because of its build in excellent streaming capabilities. There are also more flexible or powerful streaming solutions from VLC like VLM or DVBlast, but I wanted to keep it simple. If you know a good and simple setup guide for one of those systems, I would love a link in the comments to it.

Behold, there might be restrictions in your country, that prohibit even this personal use, please check before deploying this somewhere!

Prerequisite

  • A spare computer with Linux,Windows or I presume OSX. It doesn’t even need to be spare one: Since we don’t want to transcode, it uses virtually no resources.
  • a DVB card supported by your operating system (I’m using DVB-T in my example)
  • VLC

Setting up the stream

Setting up the stream consists of two parts: You need the source and the stream settings. For the source settings with DVB-T you’ll need to know the frequency of the channel you want to stream. Here in Bremen, Germany for example the frequency for ARD is 482000Khz. You can use the tool scan to generate a channels.conf when running linux (found in the package dvb-apps in Ubuntu) and probably OSX. I don’t know how to get a channels.con or the frequencies on a windows box, but maybe you can find a channels.conf for your region in the VDR Wiki. An entry in the channels.conf looks like that:

Das Erste:482000:I999B8C23D12M16T8G4Y0:T:27500:261:262:267:0:160:8468:3329:0

The red number in the second field is the frequency we need, here 482000Khz. You can try it out by opening VLC and choosing Media=>Open Capture Device (or Ctrl+C). The capture mode has to be set to DVB (DVB Directshow on Windows), you need to fill in your frequency, ignore the advanced options and hit Play. You should be able to see a channel, but not necessarily the one you wanted. There are usually three to four channels on one frequency, so you might need to tune manually to the channel you wanted in Playback=>Program. (The SID of the channel (160) is marked in green in the example above, we’ll use it later to tune to that channel automaticly.)

When that worked we can start setting up the stream. VLC can stream anything it can play, you could stream video files, webcams and a lot of other media. We’ll set the stream up as a multicast stream for a local network with RTP, so it will not work through internet connections. If you want to set a stream over the internet up, please refer to the VLC streaming documentation, but don’t forget that you might need a lot of bandwidth for multiple clients. The advantage of multicast over unicast streaming is that we need to send the data only once into the network and not to every client. The client either ignores the traffic or subscribes to it and receives it.

We need a multicast address to identify our stream and we can chose in the range from 224.0.0.0 to 239.255.255.255, e.g. 226.42.42.42. To set the stream up, chose Media=>Streaming (or Ctrl+S) and select Capture Device. Set the DVB settings up like you tried out above and select Stream. Your settings are copied into the Source field in the next dialog, so you could simply click next. But you might want to copy the settings into a text file for the automation later. Next you will have the possibility to set the stream settings up: As destination chose RTP and click Add. You should get something like the following, where you should put in your multicast address, uncheck the transcoding option and leave the other options on default settings:

After a click on next you get a few options you can leave alone and, like with the source before, a string for the stream. We should copy that one too to the text file and click on stream. We are now streaming a channel to the network, even though you cannot see anything.

Connecting with a client

To see the stream, you need to connect to it. You can do that locally on your own computer too, just open a new VLC and choose Media=>Open Network Stream. Check RTP as protocol and put in your multicast address:

You can now already save a playlist file to send to your clients later on. Make sure your playlist is empty besides that stream (Ctrl+L opens it) and then save it Media=>Save Playlist to File (or Ctrl+Y).

Automating the Server

This is supposed to be a quick and dirty solution, we won’t create start scripts for this or run it as a NT service. But if you don’t want to set the server settings up every time you start the stream, you can create a batch file under windows or run it completely from the command line on linux. (Preferably in a GNU screen session.)

Linux users can run cvlc without an interface, but can also use vlc if they want the interface. You can run the following line after replacing your my settings with the ones you gathered directly in a shell (or a shell with screen) or you can put it into a .sh file and run it as a script.

cvlc dvb-t://frequency=482000000 --ts-es-id-pid --program 160 ":sout=#rtp{dst=226.42.42.42,port=5004,mux=ts}"

In windows create a .bat file with a simple text editor and replace my example with your settings (all in one line). Of course you can configure a lot more settings with the GUI and get very complex settings in the first step for this. (On 64bit Windows, you might have to replace %ProgramFiles% with „%ProgramFiles(x86)%.) Then you can just run the .bat file instead of setting the stream up every time.

"%ProgramFiles%Videolanvlcvlc.exe" dvb-t://frequency=482000000 --ts-es-id-pid --program 160 :sout=#rtp{dst=226.42.42.42,port=5004,mux=ts}

The frequency is here given in Hz, not Khz, so you need to add three more zeros.

Conclusion

I hope this simple tutorial about streaming helped you to stream the word cup wherever you wanted. I wrote it, because I had some problems in the beginning, since the VLC documentation is being revised for the current 1.0 series and didn’t reflect always the current status.

I found it very impressing that I could stream a channel to three different computers in the same room and the audio was in sync, at least for my ears. I would love to see something like this to find it’s way into VDR or some other solution to stream audio (or even video!) at home…

What do you think of this post?
  • Awesome (5)
  • Interesting (4)
  • Useful (3)
  • Boring (1)
  • Sucks (0)

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.