Install TVHeadend Server, tvhProxy on a Raspberry Pi and enable TV playback in Plex

This guide covers how to install TVHeadend Server, tvhProxy and intergrate it into Plex all using a Raspberry Pi.

The guide you see today was originally created using a Ubuntu 16.04 server and on an old desktop, this can be still done exactly the same way but with the price point of raspberry pi’s now days, its a no brainer to set it up like this.

It is also important to note that like the other guide I wrote, the EPG was a big problem with Plex. To just reference it again, as of the 23/10/2019 Plex replaced FreeEPG with IceTV which no longer lets you use the open source applications like TVHeadend. Unfortunately due to this change,this prevented Australian’s and a couple of other countries the ability to use the EPG service. As a result Plex was not able to essentially understand and provide you with a working EPG guide which is very important. After some time research alternate ways to produce this guide, I was able to determine an alternative solution to get this back up and running. This will be included in the guide as a reference.

Requirements

This guide expects that the user has already setup Raspberry Pi either running the Raspberry Pi OS Lite (32bit) or Raspberry Pi OS Full (32bit).

Image

It is recommend to go with the Lite build option as this saves on system resources and it is not really necessary to have a full Desktop environment. Once its setup you shouldn’t really need to do anything else with it.

The Components

   
TVHeadend Server TVHeadend server is an application which you can run that allows you to use Digital TV adapters and translate them into a digital network feed that can be either streamed via VLC or any other media service/ player that supports the formats it provides.
tvhProxy This is an additional app that complements TVHeadend server to proived a virtual HD Homerun appliance. tvhProxy is a small flask app which allows us to connect TVHeadend server to Plex.
Plex Plex is the Media Center Server/ Player.

Installing TVHeadend Server

| Instruction | Illustration | | - | - | | Before we start anything, we must check for any updates and upgrade any packages that have been detected. | ` sudo apt update ` <p> sudo apt upgrade -y | | Next we will install TVHeadend Server via apt | sudo apt install tvheadend | | During the installation process, TVHeadend will ask you to enter some additional information in. | | Select Y to install. | ![Image](../assets/images/Screenshot_2020-09-25_13-27-40.png) | | The first screen you will see will ask you to enter the username of the TVHeadend web interface account. In this example I am using admin but it can be anything that you like. Select ` once you have entered a username. | ![](../assets/images/Screenshot_2020-09-25_13-30-50.png) | | Next enter a password. | ![](../assets/images/Screenshot_2020-09-25_13-32-14.png) | | You will now be able to navigate to `http://[IPADDRESS]:9981` | ![Image](../assets/images/Screenshot_2020-09-25_13-33-52.png) |

Note: If you have specified a DNS A record in your environment you can also use that.

Initial Setup of TVHeadend Server

Instruction Illustration
Open up a web browser and navigate to TVHeadend servers web interface and login with the credentials you created from the before steps.
On the welcome screen, select English for the Language and English (US) for the Language 1: under the EPG Language order. Click on Save & Next.
Next enter your Admin/ User Username and Password. In this example I did not specify Allowed Network but you can enter a IP scope that access to TVHeadend server only works for. Click on Save & Next.
In my case, I have connected to DTV USB adapters the DiBcom 7000PC and the Afatech AF9033. Select DVB-T Network for both adapters. Click on Save & Next.
Click on Save & Next.
Next TVHeadend will scan through the signals and search and find muxes. Click on Save & Next.
Tick all boxes. Click on Save & Next.
Finally click on Finish and that completes the initial setup process.
Once you have loaded into the main interface, navigate to Configuration, DVB Inputs, Networks. If there is an existing network in there, delete it. We will create our own network.
Click on Add and select type DVB-T Network
Next setup the network based on your area. Apply the settings and click OK.
Click on the newly created Network and click on Force Scan.

Hurry up and wait

At this stage its a good time to go grab yourself a cup of coffee. Generally the whole update process will take about 30 minutes or so in my testing. This is running from a Raspberry Pi 4 4GB model.