TV Headend installation

From Scottworld
Jump to navigation Jump to search

We need a bit of legacy firmware for our satellite card.

dpkg -i linux-firmware-nonfree_1.16_all.deb

TVHeadend is not part of the default repository so we need to add it:

curl | sudo apt-key add -
sudo apt-add-repository

Bring the repositories up to date

sudo apt-get update

Now install TV Headend

sudo apt-get install tvheadend

During the install you will be prompted for a username and password. Now reboot your server for the changes to take affect and to start the daemon.

You can now access the web interface via...

1. Ensure Tuners are Available for Use

Tvheadend web interface: Configuration -> DVB Inputs -> TV Adapters

On this tab, you’ll see a tree structure, with the Linux device list at the top level (e.g. /dev/dvb/adapter0)

Individual tuners are then the next level down (e.g. DiBcom 7000PC : DVB-T #0)

Click on each tuner that you want Tvheadend to use, and ensure “Enabled” is checked in the ‘Parameters’ list

If anything is obviously wrong at this point, you probably have a driver/firmware error which you’ll need to resolve before going any further.

2. Set up Relevant Network(s)

Tvheadend web interface: Configuration -> DVB Inputs -> Networks

Create a network of the appropriate type here. You can have multiple networks of the same type as necessary, e.g. to have two DVB-T networks defined, one with HD muxes, one without.

The creation process allows you to select from a series of pre-defined mux lists for common DVB sources. These are maintained outside of Tvheadend, and are downloaded from linuxtv - but they do go out of date as broadcasters move services around and national authorities change entire pieces of spectrum. As such, you should try the pre-defined values, but you may need to add muxes manually.

3. Associate the Network with the Respective Tuner(s)

Tvheadend web interface: Configuration -> DVB Inputs -> TV Adapters

Associate each of your tuners with the correct network through Parameters -> Basic Settings.

This can be as simple or as complex as necessary. You may simply have, for example, a single DVB-S2 network defined and then associate this with all DVB-S2 tuners. Or, you might have multiple networks defined - different satellites, different encoding. So, as further examples, you might define and then associate an HD DVB-T2 (e.g. H.264) network with HD tuners, while having a separate SD network associated with an independent SD (e.g. MPEG-2) tuner.

At this point, your tuners now know what networks to use: one network can appear on multiple tuners (many-to-one), and one tuner can have multiple networks.

4. If Necessary, Manually Add Muxes

Tvheadend web interface: Configuration -> DVB Inputs -> Muxes

Ideally, this is where you’ll see a list of the pre-populated muxes as created when you set up your initial network. However, should there be any issues, this is where you can manually add missing muxes. You only really need to worry about this if the pre-defined list didn’t work (e.g. because of out-of-date data as broadcasters re-arrange their services or because automatic detection hasn’t successfully found all the muxes over time.

If you do need to add something manually, you’ll need to search the Internet for details of the appropriate transmitter and settings: satellites tend not to change much and are universal over a large area, but terrestrial muxes are typically very localised and you’ll need to know which specific transmitter you’re listening to.

Good sources of transmitter/mux information include:

KingofSat for all European satellite information for UK DVB-T transmitters

Interactive EU DVB-T map for primarily central and northern Europe

Python Script for Plex integration

A small flask app to proxy requests between Plex Media Server and Tvheadend.

tvhProxy configuration In configure options as per your setup. Create a virtual enviroment: $ virtualenv venv Activate the virtual enviroment: $ . venv/bin/activate Install the requirements: $ pip install -r requirements.txt Finally run the app with: $ python systemd service configuration A startup script for Ubuntu can be found in tvhProxy.service (change paths in tvhProxy.service to your setup), install with:

$ sudo cp tvhProxy.service /etc/systemd/system/tvhProxy.service $ sudo systemctl daemon-reload $ sudo systemctl enable tvhProxy.service $ sudo systemctl start tvhProxy.service Plex configuration Enter the IP of the host running tvhProxy including port 5004, eg.: