First of all I can’t help but recommend you read the Angry Technician’s post How to stream EVERY channel from Freeview onto your network as he’s written an excellent tutorial on what I’m going to also try and explain below. I’ve spent some time fine tuning (huh, get it? cause we’re tuning in…oh forget it) my setup based on his tutorial and hopefully it will provide you with some more examples and help in getting TV streaming across your network.
What you will need:
– Some technical knowledge.
You could say this is quite an ambitious project and you’ll need to be able to do things like install linux on a dedicated machine, install tuners, get drivers working etc. If all this is new to you, good luck, and I still recommend you give it a go, but I can’t promise I’ll be able to help you if you get stuck. Admittedly I got it all working within a couple of hours, and at the time of first setting this up, I was quite a linux novice. Through this project, I have acquired a lot of skills and knowledge of linux, so for me it’s been very good.
– Actually a bit of technical [networking] knowledge
Sweet so you have some linux knowledge maybe? That’s great but this could become quite an intermediate to expert project. It really depends on the network you’re plugging the TV Box into.
I would highly recommend at minimum you use a Gigabit Switch in your network. There’s quite a lot of ways you could have the traffic flow to clients, and each configuration suits different scenarios. E.G. If you have specific hosts purely for receiving TV, you could simply have a separate VLAN the TV box and clients are connected to. Traffic would then just spam out all connected ports in the VLAN, basically this would be a broadcast network. This probably isn’t practical though, and what you would do instead is enable a feature called IGMP Snooping (and possibly filtering). This will probably be satisfactory enough for small networks, but if you are running the multicast over a layer 3 network, you will need to have a look at PIM-DM or PIM-SM.
I’m a network engineer but found this project quite full on getting it working throughout the network it’s currently running in (quite a few layer 3 switches using PIM-SM). I put this under intermediate to expert because if you’re running this through a layer 3 network, that’s exactly where it’s defined by Cisco. Cisco documentation and configuration is minimal in the Cisco CCNP curriculum, and only the CCIE Routing and Switching book will you find a bit more detail. If your network is small and all you have is a managed layer 2 switch[s] you’re probably fine, as you’ll only need to enable IGMP Snooping and possibly filtering on your devices. Don’t let above drive fear into you in trying to set this up, but you may just need to do a bit of background reading on multicasting 🙂
-At least 1 Terrestrial or Satellite TV tuner.
This really comes down to your budget and how many channels you want to be able to stream. Basically you will need at least 1 tuner per frequency for channels you want to receive. Here in Christchurch NZ, we currently have 16 TV channels and 3 Radio stations transmitted over 3 frequencies. This means I only need 3 tuners to be able to stream all channels at once. Effectively 1 dual TV card and 1 single tuner.
– Dedicated PC
This could just be an old 1GHZ pc with 1gb of ram. Nothing fancy, as we’re simply sending the received digital data and multicasting the traffic on to the network. A 1Gbit Network card would be recommended though. Make sure you have enough free PCI/PCI-E/USB ports for Tuners though.
Post OS installation
I won’t go into detail with physical installation, nor installing your choice of linux (I recommend Ubuntu 12.04) but once you do have it installed, probably the first thing I’d suggest you do is make sure your tuners are coming up correctly and working. Simply open a terminal and enter “ls /dev/dvb/”
Depending on how many tuners you have, you should see adapter0 and up for each tuner. If you don’t see any tuners, it’s probably time to start googling support for your tuner, but you can also find more log info by typing dmesg. I’m simply suggesting all this as the HVR2210 didn’t work out of the box for me. If you have this card, I believe my solution was:
cd /lib/firmware/ sudo wget http://www.steventoth.net/linux/hvr22xx/firmwares/4019072/NXP7164-2010-03-10.1.fw Reboot the machine
Still with me? Lets get started!
Programs to install:
- Ubuntu 12.04
- VLC 2.0.1 – Possibly not needed, but very helpful for diagnosis
- Vino – VNC Server that comes with Ubuntu
- dvb-apps (A package containing various different tools for dvb cards)
- dvblast (Made by the same people as VLC. This is what multicasts all the channels out)
- minisapserver (for creating the channel playlist in VLC)
- udpxy (converts the RTP multicast streams into unicast HTTP streams. Currently useful for viewing the TV streams on wireless devices.)
Open a terminal and enter the following:
sudo -s apt-get update apt-get install dvb-apps minisapserver vlc
– Apt-get would probably be one of my favorite things since using linux. Ubuntu/linux comes pre-loaded with a database of websites hosting apps and utilities that you can request to download from without having to manually go to the website, find the download link, wait for it to finish and then install. Instead you can do above and it will download it and install it for you! There’s also a gui “app store” as such called synaptic package manager, and also the ubuntu software center.
You could also simply add dvblast to that list above, but I believe I had issues with SD channels (sound not working) which resulted in me needing the current unstable version. More info is available on the commands below again on another Angry Tech post, but simply copy and paste below in a terminal and it “should” install fine. I’ve done this on linux mint and ubuntu with no issues.
sudo apt-get install git git clone git://git.videolan.org/bitstream cd bitstream sudo make install git clone git://git.videolan.org/dvblast cd dvblast sudo make install
DVBlast is now installed so we can now get on to the first step which is scanning your local terrestrial tower. DVB-apps comes with some configs for different terrestrial towers, and you can see if your local one already exists by typing “ls /usr/share/dvb/dvb-t/”
In my case, my local tower here in Christchurch New Zealand didn’t exist, so I just entered “sudo gedit” into a terminal, which opens the gui text editor, and created and saved the following:
Sugarloaf, Christchurch NZ # # Channel allocation details for NZ can be found at # http://www.rsm.govt.nz/cms/policy-and-planning/current-projects/broadcasting/digital-television-2007-frequency-plan # # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy # Multiplex DA T 562000000 8MHz 3/4 NONE QAM64 8k 1/16 NONE # Multiplex DB T 578000000 8MHz 3/4 NONE QAM64 8k 1/16 NONE # Multiplex DC T 594000000 8MHz 3/4 NONE QAM64 8k 1/16 NONE
I had to find out the frequencies used, which wasn’t too hard. Just do a google and find out what your local tower is and what frequencies are used.
Once you have your configuration file sorted, we use a program called “scan” which does just that. It will tell us the all important PIDs (the unique identifiers for each channel) and a lot of other helpful information.
Just run the following command, which will output what it finds into a file called channels.txt
scan /usr/share/dvb/dvb-t/nz-christchurch -u > channels.txt
If you open channels.txt, you will find something similar to the following:
TV ONE:682000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:280:330:1200 TV2:682000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:281:331:1201 U:682000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:282:332:1202 TVNZ 7:682000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:283:333:1203 TV3:698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:450:400:1300 FOUR:698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:451:401:1301 TV3 PLUS1:698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:452:402:1302 C4:698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_
The only thing we’re really interested in is the Channel, the frequency, and the PID. These are the first and last values, so as an example with the first one, the channel is TV ONE, the frequency is 682MHZ, and the PID= 1200, which I also made bold as you can see.
What you now need to do, is make a config file for each frequency which will then be used for each tuner. So if your local tower has 3 frequencies, you will need 3 config files, and 3 tuners.
I’d suggest you just make a folder in your home directory called dvb, which you store each config file in.
Below are my 3 config files.
/home/localadmin/M1.cfg ;TV1 188.8.131.52:5004 1 1200 [ff08::1]:5004@[2001:17:17::1] 1 1200 ;TV2 184.108.40.206:5004 1 1201 [ff08::2]:5004@[2001:17:17::1] 1 1201 ;TVNZU 220.127.116.11:5004 1 1202 [ff08::6]:5004@[2001:17:17::1] 1 1202 ;TVONE+1 18.104.22.168:5004 1 1205 [ff08::7]:5004@[2001:17:17::1] 1 1205
/home/localadmin/M2.cfg ;TV3 22.214.171.124:5004 1 1300 [ff08::3]:5004@[2001:17:17::1] 1 1300 126.96.36.199:5004/mtu=2000 1 1300 ;FOUR 188.8.131.52:5004 1 1301 [ff08::4]:5004@[2001:17:17::1] 1 1301 ;TV3PLUS1 184.108.40.206:5004 1 1302 [ff08::5]:5004@[2001:17:17::1] 1 1302 ;C4 220.127.116.11:5004 1 1303 [ff08::8]:5004@[2001:17:17::1] 1 1303
/home/localadmin/M3.cfg ;PRIME 18.104.22.168:5004 1 1404 [ff08::9]:5004@[2001:17:17::1] 1 1404 ;Maori TV 22.214.171.124:5004 1 1400 [ff08::10]:5004@[2001:17:17::1] 1 1400 ;Parliament TV 126.96.36.199:5004 1 1401 [ff08::11]:5004@[2001:17:17::1] 1 1401 ;Trackside 188.8.131.52:5004 1 1402 [ff08::12]:5004@[2001:17:17::1] 1 1402 ;ChineseTV 184.108.40.206:5004 1 1403 [ff08::13]:5004@[2001:17:17::1] 1 1403 ;TV9 220.127.116.11:5004 1 1413 [ff08::14]:5004@[2001:17:17::1] 1 1413 ;TV33 18.104.22.168:5004 1 1405 [ff08::15]:5004@[2001:17:17::1] 1 1405 ;ChoiceTV 22.214.171.124:5004 1 1407 [ff08::16]:5004@[2001:17:17::1] 1 1407 ;BaseFM 126.96.36.199:5004 1 2002 [ff08::20]:5004@[2001:17:17::1] 1 2002 ;RadioNZ National 188.8.131.52:5004 1 2000 [ff08::21]:5004@[2001:17:17::1] 1 2000 ;RadioNZ Concert 184.108.40.206:5004 1 2001 [ff08::22]:5004@[2001:17:17::1] 1 2001
What’s this doing? the semicolon is just specifying a comment purely in this case just to help you identify the channel. Next line in the multicast address chosen:port chosen. 1 sets the stream to always be on, followed by the unique channel PID.
If you looked closely you will notice I’m also doing IPv6. IPv6 addresses must be specified in brackets due to using semicolons (which would otherwise be followed by a port). As I mentioned earlier, this machine has several network cards in it. I then have the IPv6 address specified that I want the IPv6 multicast to send out of. Otherwise the stream will default to eth0. This is specific to where this box is used and your set up will probably be quite different.
Note here that you could have used a route in the linux routing table to also specify the out going network card. This is what I had set up before knowing that I could use DVBlast to specify out. The reason I changed it though is because after an unspecified amount of time, routing would stuff up and the IPv6 multicast started sending out with the IPv6 link-local address, not the global-address, which had bad results due to using a layer 3 switched network.
Now that the config files are done, it’s time to actually start the streams.
Continuing with my example, put the following 3 commands in separate terminal windows:
For tuner 0 (TVNZ Frequency): dvblast -a 0 -c /home/localadmin/dvb/M1.cfg -f 578000000 -m qam_64 -b 8 -e For tuner 1 PRIME/KORDIA Frequency): dvblast -a 1 -c /home/localadmin/dvb/M3.cfg -f 594000000 -m qam_64 -b 8 -e For tuner 2 (Mediaworks Frequency): dvblast -a 2 -c /home/localadmin/dvb/M2.cfg -f 562000000 -m qam_64 -b 8 -e
Here’s what each parameter does:
-a n tells dvblast to use tuner number n for this multiplex. Obviously, you can’t use each tuner more than one at any one time. Numbering starts at 0, not 1. -c nameoffile.cfg tells dvblast to use the config file you just write. It doesn’t matter where you save it. -f 000000000 is where you specify the frequency for this multiplex. -m qam_x the modulation type for this multiplex. And then… -b n the bandwidth for this multiplex. -e Finally, -e tells dvblast to also stream the EPG data.
If you wanted to do them all in 1 terminal, just put “&” on the end of the command, enter, then the next dvblast instance.
Now you should be able to open VLC and type in each multicast address to view each stream (provided you have a route on your host [and the sever] to the multicast range.
2.5 SAP configuration
SAP allows you to simply pick the channels from a nice friendly list of channel names in vlc playlist. All you need to do is create a config file for it like below, and save it to /home/localadmin/dvb/sap.cfg
# sap.cfg - Configuration file of the mini SAP server # Global miniSAPserver options [global] # Number of seconds between announces. 5 is default. Internet announces better use 30. sap_delay=5 # The network interface on which to stream. #interface=eth2 [program] type=rtp name=TV1 user=localadmin machine=tvserver site=mattie47.com address=220.127.116.11 port=5004 [program] type=rtp name=TV1v6 user=localadmin machine=tvserver site=mattie47.com address=ff08::1 port=5004
Then open a terminal and run: sapserver -c /etc/dvb/sap.cfg
It looks like SAP announcements was implemented in one of the latest versions of DVBlast as seen here.
So, I hope this was helpful in getting multicast IPTV streaming on your network. Possibly a bit of work, but it’s pretty cool to have setup. If you’ve gone through above, there’s also another pretty good IPTV multicast program for linux called MuMuDVB. I’d recommend also checking it out.
how can DVB-S Trasnpoder stream ?
hello mattie . you can help my for DVB-S stream ?
I’m currently on holiday in Europe and can’t really provide much assistance.
What I will say though is that it shouldn’t be that hard to set dvb-s up with it. Note that you will need a separate tuner for each transponder of channels that you want to stream.
The dvblast readme here: https://github.com/gfto/dvblast is pretty helpful and should be good enough for helping you figure out how to do satellite.
Alternatively, there’s another pretty good program similar to dvblast called mumudvb which you could also look at.
Hi there, I know this post is a bit old, but thought maybe you could help me 🙂
Any idea on how to extract captions from these NZ channels?
No worries. It depends on what you’re trying to achieve, but if subtitles are available, they’re encapsulated already within the data stream.
If you’re viewing streams in VLC for example, you can just turn on subs where available.
Probably would suggest asking a question on geekzone.co.nz if your question extends further than that.
“interested in … the PID” ” PID= 1200″
I think you are getting the component names confused.
What you need is the Service ID (SID).
The last column from the scan table data is the SID.
For completeness the “hierarchy” of components is
Network ID — corresponds to the service provider eg Freeview
…Transport ID — corresponds to the frequency (and for satellite polarization as well)
…… Service ID — corresponds to the broadcast service (eg TV One)
………..Video PIDs — corresponds to the video stream (usually only one, or none at all for radio)
………..)Audio PIDs — corresponds to the audio stream(s) (could be multiple eg English as well as Maori and or as well as English audio description for the visually challenged)
If you run dvblast (so long as you know the appropriate multiplex frequency) with a run time socket you can use dvblastctl to connect to the socket and amongst the commands get the full NIT (network information table) and if that should list SIDS with corresponding LCNs. So if you know that what number TV One uses for the LCN on the EPG you can then see the Service ID for that LCN. Or use dvblastctl with the get_sdt command to see service IDs and the service name (if provided).
If you use the newer dvbv5scan from the v4l-tools, then that produces a channels.conf file where the names of the parameters are give in full. But I fear that the very very latest dvbv5scan from the git repository is dumping (valid) but not matching the appropriate service for the transport and service ids from a scan.
Also if you want to use udpxy to convert from multicast to unicast, you have to specify the udp option otherwise the default RTP protocol sent by dvblast (which I think is RTP on top of UDP) will not be recognized. And do not forget that if you are running a firewall, this will by default block multicast packets even for sending and receiving on the same host. When using vlc make sure you have the mutlcast interface set to your primary network device eg miface=eth0 in vlcrc because vlc does not necessarily use the correct one on hosts with more than one network interface (which means wifi as well as ethernet).
FFmpeg can be used to extract subtitles from a DVB transport stream to create either text or image. It is probably best to record it first (ie save to a file on disk) rather than doing it directly from a live stream. And there can of course be more than one subtitle track in a DVB transport stream.
Another issue is the above article is that for configuration files, the semi-colon was used for comment lines.
I do not know when the change was made but for DVBlast version 3.4 onwards, the comment marker (only valid at the beginning of the line) was changed to a hash “#”, otherwise you will see strange error messages
warning: getaddrinfo(host=;, port=3001) error: No address associated with hostname
because it thinks that “;” is a host name because it is no longer the comment marker.