The Angry Technician’s Guide to streaming Freeview via VLC, you Idiots

On Wednesday, the England vs. Slovenia World Cup match brought many a broadband connection across the UK to its knees as iPlayer, the BBC’s streaming video service, hit a peak of 800,000 concurrent streams (mostly skiving gits who should have been working).

Even before the match, IT professionals in schools were marginally backing a meltdown in a poll on EduGeek, realising that demand coupled with shared local authority bandwidth would likely scupper chances of getting a decent stream in schools. That prediction was largely borne out on the day, though experiences varied, with some schools getting a decent feed, while others got only a few minutes into the game before it stuttered to a halt.

We had no problems watching the game at all; we had more than 25 computers across the school watching a high-quality feed, despite having nothing more than an ADSL connection for the entire site.

How?

I cheated.

I realised the night before the match that I already had everything I needed to serve up a live site-wide feed without using an Internet streaming service at all. Instead, I used a TV tuner to stream the DVB-T Freeview feed straight off the air and onto our network. Here’s how you could do the same.

Why?

As I’ve already explained, this means you aren’t relying on an Internet streaming service with questionable reliability when faced with high demand. You are relying on having decent Freeview reception, but that doesn’t tend to vary much unless there’s a thunderstorm. (FYI, it’s probably best not to do this during a thunderstorm). You also won’t saturate your Internet connection bandwidth with multiple streams, meaning those people on site actually doing their job will not be impeded.

Another key advantage is that the standard Freeview feed is a superior quality picture compared with most online feeds, meaning your viewing experience should be better.

Lastly, doing this is very cool, and will definitely get you laid. Definitely. Even during a thunderstorm.

You will need

Your brain. I know this may be something of a liability, but you are going to need to pay attention. This guide is detailed and may seem complicated, but once you understand how it all works the actual process is not that hard.

A working DVB-T tuner device on a computer. There are a lot of these on the market, with PCI, PCI-E, and USB versions available. Which sort you use is pretty much irrelevant so long as it works. I’ve had a lot of success with the Hauppage WinTV Nova-T USB Stick. Whatever you use, make sure you can receive a TV stream using the manufacturer’s software before you proceed, or you could face a very frustrating time with the rest of this guide.

A working network that the computer is connected to. Again, I’m not helping you with this bit, and I’m only covering IPv4 networking. By the way, it will help if your network switches support IGMP multicast filtering, and have this feature turned on. More on this later.

VLC Media Player. This free software is available for Windows, Mac, and Linux. I used Windows but the procedure should work equally well on other platforms since VLC is almost identical on each. I used VLC 1.1.0, the latest version available at the time.

Details of your local Freeview transmitter frequencies. You may be able to get these directly from your existing software, but if not, first find out which transmitter is nearest you. That site will also tell you the frequencies, but it rounds them up to the nearest 0.1MHz, and VLC prefers the more precise kHz values. You should be able to find those sources online; I used an online database on the Medion support forums.

You’ll notice that only a few frequencies are listed, despite there being many more channels than this. This is because Freeview bundles channels together using multiplexing into a single stream on one frequency. For example, most of the BBC channels are on a single frequency. The site where you checked which transmitter is nearest you should also show which channels are bundled together, and therefore which frequency you’ll want. Getting individual channels out of that frequency is taken care of by the receiving software, as you’ll see later.

A TV licence. You may not like or agree with it, but in the UK, your premises must have a TV licence if any channel from Freeview is to be displayed. Most schools probably have this already. Anyone else in the UK needs to be aware that you are a thieving git if you are watching live TV without a licence (this applies to using iPlayer too). Breaking the law is bad, mkay?

What to do

1. Open VLC, go to the Media menu, and click Streaming.

2. Click on the Capture Device tab. Change the Capture mode to DVB DirectShow, change the Device Selection to DVB-T (and pick the correct device if you have more than one tuner), then enter the required frequency into the Transponder/multiplex frequency box (using the information you looked up earlier). Depending on your device, you may or may not need to change the Bandwidth setting. If it doesn’t work on Undefined, change it to 8Mhz.

Once that’s all entered, click on Stream.

3. Click Next on the Source section; you’ve set all this up on the previous screen.

4. In the New destination box, pick RTP / MPEG Transport Stream, and click the add button.

We’re using RTP/TS because it support multicast/broadcast, which will mean the bandwidth consumed by the device streaming the connection is the same regardless of how many clients watch the stream. As I said earlier, I had 25 machines receiving the stream, and the bandwidth usage on the broadcast machine never went above 5Mbps.

5. In the Address box, you need to enter a multicast or broadcast address to stream the video to.

  • If your network switches support multicast, pick a multicast address. There’s a long and detailed document from the IANA about picking one, but unless you are already using multicast on your network then you really just need to pick something in the 239.255.000.000239.255.255.255 range, which is identified by the IANA as the Site-Local Scope. Anything in this range should work. I used 239.255.1.1 as shown below.
  • If your network doesn’t support multicast, or you don’t want to use it for whatever reason, then enter the broadcast address for your local subnet.

The advantage of using multicast instead of broadcast is that when using broadcast, every device on the network will have the stream broadcast to it and use up some bandwidth, while with multicast, only those devices listening for the stream will consume bandwidth.

Make sure that the Activate Transcoding box is NOT ticked. Unless you are really screwed for bandwidth, you don’t need to do any transcoding since the video stream is already compressed when it comes over the air, and transcoding introduces an extra layer of complexity that you just don’t need. I found the bitrate was between 3-5Mbps without transcoding; low enough for even a 10Mbps connection to cope with, and a walk in the park for a 100Mbps client.

Leave the port at 5004 unless you have a good reason to change it, then click Next once you’re done here.

6. Configure any advanced options. I didn’t touch any of this stuff, but knock yourself out if you know what you’re doing. Don’t tinker unless you know, or you’ll probably break something and coming crying to me like a baby. I will be… unsympathetic.

(I did experiment with SAP announcements, but it seemed a little buggy, so I didn’t use it.)

Click Stream once you’re done.

VLC should now be streaming away merrily. You won’t see or hear anything, because all you’re doing is streaming to the network, not playing the file locally.

7. Change the channel. Remember how Freeview has multiple channels on one frequency? Well, when VLC started streaming, it just picked whichever channel it felt like on the frequency you entered in step 2. To change the channel, go to the Playback menu, click Programme, and select the channel you want.

If the channel you want isn’t there, you either need to try a different frequency, or you can’t pick up that channel in your area.

8. Configure your damn firewall already. If you’re using a client-side firewall such as the one built in to Windows, you need to open up some incoming ports on every client you want to receive the stream. If you left the port setting alone like I told you in step 5, you need to open up UDP ports 5004 and 5005.

You shouldn’t need to change anything on the firewall to broadcast the stream, only to receive it. The exception is if you are using one of those stupid firewalls like the one in Symantec Internet Security that blocks any traffic by default, instead of just incoming connections.

9. Now open a second copy of VLC. You can do this on the same machine (open the firewall!), or skip straight to trying another machine on the network if you’re feeling cocky. Go to the Media menu, and this time pick Open Network Stream.

10. Enter rtp://@ followed by the streaming address you entered at step 5, e.g. rtp://@239.255.1.1

Now click Play.

Congratulations, genius

You’ve streamed Freeview to your network using VLC! The screenshot above shows the stream I broadcast alongside the web interface for one of my switches, with the graph showing multicast working successfully: only the clients actually listening for the stream are consuming bandwidth.

Or not?

Maybe you didn’t get it working, because you’re an idiot. That’s not really something I can help you with. This process worked for me, and it should work for you if you follow it properly. Unfortunately, this guide represents pretty much all I currently know about streaming with VLC, so you may want to consult your favourite search engine if replicating these steps doesn’t work.

Some tips

Here’s a couple of tips to make things easier for you and your users:

  • If you are able to, create a new A record on your local DNS server so you don’t have to remember the address you entered in step 5. You can use this when you set up the streaming in step 5, when you connect in step 10, and in the shortcut described below.
  • To make things easier on your users, make a shortcut for them that automatically starts the stream in fullscreen. An example of the command line you might use is "%ProgramFiles%\VideoLAN\VLC Media Player\vlc.exe" -vvv rtp://@239.255.1.1 --fullscreen
  • Turn on deinterlacing in VLC. This will improve your picture significantly whenever there is fast-moving action showing. Go to the Tools menu, click Preferences, then click the Video button on the left and play with the settings highlighted below. The selected options are the ones that worked best for me.

Useful? Useless? Feedback on this guide in the comments, you idiots.

Tags: , , , ,

About The Angry Technician

The Angry Technician is an experienced IT professional in the UK education sector. Normally found in various states of annoyance on his blog. All views are those of his imaginary pet dog, Howard.

31 responses to “The Angry Technician’s Guide to streaming Freeview via VLC, you Idiots”

  1. bikeritdude says :

    Now that’s a good idea, i’ll try that next time. We showed it in our Main Hall using a standard Freeview box.

    Thanks for the tips!

  2. _techie_ says :

    We did this even simpler….
    setup a freeview box in the main hall attached to the big screen! Better than any pub IMO!

    • AngryTechnician says :

      If your school is small enough to get everyone into the main hall comfortably, then I suppose that is an option. That wasn’t practical for us.

      I also heard of one secondary school that had everyone in the hall, and the kids got a little out of hand when England scored, so there are advantages to showing it to smaller groups.

  3. Paul says :

    I’ve been tinkering around with VLC for the last week, getting it set up to stream a webcam live to a laptop in the main hall to display on the projector. I know it was slightly different, but this guide would have come in incredibly useful to stream the webcam to whichever machine wanted it (eg the plasma in reception, etc). I used UDP unicast, but in hindsight should probably have gone with the multicast option.

    VLC is a wonderful tool if you know what you’re doing with it :)

  4. DrCheese says :

    Yeah, we did this as our SMT was worried that putting all of the students in the hall would be a little hard to police. VLC is brilliant!

    As for the deinterlacing thing adding
    –video-filter=deinterlace
    Will force it on by default.

  5. Claudio says :

    Awesome idea. And well explained. Might use that sometime in the future. Congratz!

  6. Gerard says :

    Thanks for an excellent guide!!

    I hope I don’t sound overly lazy here – I normally like to dabble with these things myself, but I’m looking at purchases here so I prefer to know how many of x I need.

    Before I embark on what sounds like an extremely funky idea to replace the now very dead Exterity Freeview streaming system (exterity.co.uk) we have in our school, do you have any idea if I can use this guide to stream multiple Freeview channels as individual streams?

    For example, making BBC 1 and ITV available as 2 individual streams?

    Would I need to (or be able to) run several instances of VLC? One for each channel, presumably.

    Regards,
    Gerard

    • AngryTechnician says :

      We had Exterity at my last school, and I naturally wondered the exact same thing. The answer is ‘Yes’ – with some different software. Expect a guide next week when I’m back from holiday…

      • Gerard Sweeney says :

        Fantastic stuff.

        I look forward to seeing the fruits of your labour. Enjoy your holiday.
        If your summer “holiday” is anything like mine, you’ll need it.

        Regards,
        Gerard

        • AngryTechnician says :

          Quick update on this – today I put the finishing touches to my prototype TV streaming box, and it’s currently streaming 12 individual TV channels (and 1 radio station) off of a dual-tuner WinTV card. Will start work on the guide tomorrow, but it’s not going to be quite as step-by-step as this one given the increased complexity!

          • Gerard Sweeney says :

            Brilliant! That’s 12 channels and 1 radio station than our current obscenely expensive Exterity system is not currently streaming.

            I really appreciate any guide you can put together. Don’t concern yourself with a step-by-step screenshot-filled epic. Anything you can manage is greatly appreciated.

            Did you use a particular make of tuner card? I’ll be forced to use companies which are “ABC” registered (a catalogue of companies our Council recognises as being “real”) – so sadly Amazon and EBay are out the window. Tch.

            Looking at our 2 main ICT suppliers Misco and CPC – they seem to have KWorld or ComPro tuners. Should there be something to look for in the specs? Other than dual tuner, I mean :)

            Thanks again,
            Gerard

            • AngryTechnician says :

              I’ve been using Hauppage WinTV cards. Anything that works under Linux will do. Dual tuner isn’t a must, but if you go single tuner you’ll need a motherboard with at least 6 PCI slots (or be willing to use USB tuners).

  7. Gerard Sweeney says :

    (Erm that should have been about the summer holidays when the Staff are away – always my busiest time of the year!!)

  8. Milan says :

    I am probably an idiot, but I couldn’t make VLC to successfully stream from one PC to another.

    Basic idea was to stream content captured by VLC from TV tuner card on desktop PC, to laptop over LAN. They are connected through modem (router or whatever its name is) for ADSL.

    I read many articles and watched videos that describe this process (though in both cases with older interface of VLC) and none of settings didn’t work.

    I tried to stream from TV card, AVI, MKV, MP4 and MP3 files, with and without transcoding, with and without firewalls, over UDP and RTP and nothing worked.

    I mostly used UDP since this what tutorials mostly contain, and I think that stream was sent from desktop to laptop by looking into network activity icon in bottom right, and from lamps on modem, but when I open stream on laptop, nothing is shown.

    What can be reason for this problem and is there any solution?

    Thanks in advance.

    Note: desktop runs Win XP while laptop uses Win 7; both VLCs are in latest version; I also tried reverse streaming (laptop-to-desktop) and same thing happened.

    • AngryTechnician says :

      Two things:

      1. Have you tried disabling Windows Firewall if it is enabled?
      2. Have you tried streaming and receving on the same machine (by opening two instances of VLC)?
  9. PartyMarty says :

    Hey just wanted to let you guys know that VLC 2.0.1 crashes when I attempt to even play from the tv tuner, I went back to version 1.1.9 and it works pefectly.

    • The Angry Technician says :

      That’s odd: 2.0.1 works fine for me. If anything it’s actually working better, as pre-2.0 versions don’t decode the EPG on HD channels, but 2.0 onwards does.

  10. philipb2011 says :

    Some great guy has created a playlist of most of the Freeview channels so you don’t have to manually tune them in.

    http://forum.videolan.org/viewtopic.php?f=29&t=100346&p=338165&hilit=freeview#p338165

  11. Mike O'Hara says :

    Hi there,

    This sees to be a great way of streaming Freeview to a network. The trouble is that I only have a stand alone desktop and I’m not on a network. Do you have a tutorial on how to stream Freeview to a desktop using VLC (which I adore)?

    Mike

    • The Angry Technician says :

      Just click on Open Capture Device in step 1 instead of Streaming, follow step 2 as-is, and at the end of step 2 the button will be marked Play instead of Stream. Click it, and the TV tuner will start playing.

  12. Gary says :

    I am an idiot, so maybe you could help me stream the DVB-T stream to Flash Media Live Encoder?

  13. owen says :

    Great guide, however, when a stream is turned on it seems to replicate a DOS attack on slower network devices, any ideas?

    Thanks
    Owen

  14. Muza1000 says :

    Great idea! however, is it possible to use this solution over Android STBs? that is i use a PC with the cards as you mentioned to capture the channels and stream over the network with VLC for Android.

  15. Mike says :

    Awesome guide. I am thinking of streaming tv from my house and using remote access to start the stream. Is it possible to create a command shortcut to automatically configure the stream for a specific channel so the home machine isn’t streaming 24/7?