Tvheadend is a streaming server for live TV broadcasts. It can handle streaming and recording over-the-air terrestrial DVB-T/T2 broadcast TV, like Freeview in the UK. It can also handle other forms of TV streaming, including cable (DVB-C), satellite (DVB-S and DVB-S2), ATSC, and IPTV.
o set up a Tvheadend DVR, you'll need the following:
- Raspberry Pi 2, 3, or 3B+ with Case
- MicroSD card with Raspbian installed
- A high-quality power supply (5V @ 2.5A)
- A USB DVB-T/T2 tuner for OTA TV reception or a Raspberry Pi TV HAT
- A DVB-T/T2 antenna
- Another PC, for SSH connections, with an SSH client installed
The Raspberry Pi Foundation released a Pi TV HAT which uses the Raspberry Pi's GPIO pins to become a DVB-T2 receiver. If you don't have one of these, you can use a typical USB DVB-T/T2 tuner instead.
You'll need to install an operating system onto your Raspberry Pi first; this guide will assume you've flashed the latest version of Raspbian Lite onto a microSD card and your Pi has internet connectivity. It's also a good idea to run the usual commands on first boot to update your Pi and change the default password:
sudo apt update
sudo apt upgrade
If you haven't already, after you've flashed your microSD card, add a file named ssh without a file extension to your boot partition. This will enable you to connect via SSH. You'll have to check your Pi's IP address, which you can do using a network monitoring app on your smartphone.
Once your Pi boots, plug your DVB-T/T2 tuner into your Pi (or attach to the GPIO pins, if you're using the HAT) and connect via SSH. Confirm that your USB tuner is working:
Assuming that it is, check that the firmware for your tuner exists and loads:
dmesg | tail | grep dvb
If the command returns nothing (or there are no errors), your DVB-T/T2 tuner should be ready. If the command returns log snippets that suggest your firmware can't load, or the firmware files you need are missing, you'll need to download them.
A Git repository from the developers of OpenELEC, a Linux media center distro, contains a large number of firmware files for various tuner chipsets. To install these onto your Pi, run the following commands on your terminal and reboot:
sudo apt install git
git clone https://github.com/OpenELEC/dvb-firmware.git
Step 2: Installing Tvheadend
To install Tvheadend and any additional packages, type:
sudo apt install tvheadend
Type Y and hit enter to agree to installation. As it begins, you'll need to provide a username for Tvheadend for administrative access once it's installed. Type a suitable username in, then hit enter.
You'll need to provide a password, so type one in and hit enter. A final menu provides information on what to do once Tvheadend has installed to access the web interface on port 9981; just hit enter to continue installation.