In the age of Netflix, watching live TV seems old school, but you can’t always find every show or movie you want on the streaming service. The alternative is to pay for cable or satellite TV, and who wants to do that?

Luckily, if you’re in a country with terrestrial TV broadcasts, you can cut the cord and record live TV on a Tvheadend NVR running a Raspberry Pi instead. Here’s how you do it.

What is Tvheadend?

Tvheadend is a live streaming server. It can handle DVB-T/T2 off-the-air TV streaming and recording like Freeview in the UK. It can also handle other forms of streaming TV including cable (DVB-C), satellite (DVB-S and DVB-S2), ATSC and IPTV.

This guide will focus on using Tvheadend with a DVB-T/T2 tuner for terrestrial TV, but many of the Tvheadend setup instructions will remain the same if you prefer to use Tvheadend to record TV from other input sources. ,

What you need

To set up your Tvheadend DVR, you will need the following:

  • Raspberry Pi 2, 3 or 3B+ with case
  • MicroSD card with Raspbian installed
  • High quality power supply (5V @ 2.5A)
  • USB DVB-T/T2 tuner for receiving OTA-TV or Raspberry Pi TV HAT
  • Antenna DVB-T / T2
  • Another PC for SSH connections with SSH client installed

The Raspberry Pi Foundation released a Pi TV hat that uses Raspberry Pi GPIO pins Raspberry Pi GPIO pins to become a DVB-T2 receiver. If you don’t have either of these, you can use a regular USB DVB-T/T2 tuner instead.

Step 1: Preparing the Raspberry Pi

First you will need to install an operating system on your Raspberry Pi; This guide assumes you have installed the latest version of Raspbian Lite on a microSD card and your Pi has an internet connection. It is also recommended to run the usual commands on first boot to update the Pi and change the default password:

sudo apt update sudo apt upgrade passwd 

If you haven’t already, after you’ve flashed your microSD card, add a file named ssh without file extension to your bootable chapter. This will allow you to connect via SSH. You will need to check your Pi’s IP address, which can be done with a network monitoring app. many more. much on your smartphone.

Once your Pi boots up, connect the DVB-T/T2 tuner to your Pi (or connect to the GPIO pins if you’re using a HAT) and connect via SSH. Make sure your USB tuner is working:

 lsusb 

Assuming this is the case, check that the firmware for your tuner exists and is loading:

 dmesg | tail | grep dvb 

If the command returns nothing (or no errors), your DVB-T/T2 tuner should be ready. If the command returns log snippets indicating that your firmware cannot be loaded, or the firmware files you need are missing, you need to download them.

The Git repository from the developers of OpenELEC, a Linux media center distribution, contains a large number of firmware files for various tuner chipsets. To install them on your Pi, run the following commands on your terminal and restart your computer:

 sudo apt install git git clone https://github.com/OpenELEC/dvb-firmware.git cd dvb-firmware ./install sudo reboot 

Step 2: Install Tvheadend

To install Tvheadend and any additional packages, type:

 sudo apt install tvheadend 

Enter Y and press Enter to agree to the installation. When you get started, you will need to provide a username for Tvheadend for administrative access after installing it. Enter a suitable username, then press Enter.

You will need to enter a password, so enter one and press Enter. The last menu contains information on what to do after installing Tvheadend to access the web interface through port 9981; just hit enter to continue with the installation.

Step 3Setting up Tvheadend

Once the installation is complete, open a web browser and navigate to http://YourIPAddress:9981 replacing «YourIPAddress» with your Pi’s IP address. Use the username and password you created during installation to gain access.

Tvheadend Web initial setup

Select languages ​​for both the web interface and EPG (electronic program guide, for TV programs) and click » Save and then» .

In the next menu, unless you plan to allow access to Tvheadend outside of your internal network and assume your IP address is in the 192.168.1.0/24 range, enter 192.168.1.0/24 in section » Allowed Network» . You can also provide additional usernames and passwords for the standard administration and standard user account; complete the username and password sections if necessary, and then click » Save and Continue» .

The next step is setting up your tuner. Tvheadend should already detect your DVB-T/T2 tuner; for my config it was listed in networks 2 . Select network type as Network DVB-T. Again, click Save & Next to continue.

To get your tuner to scan the channels you want, in the next menu you select «predefined multiplexers» which are lists of the appropriate frequencies to scan. Find the one that matches your country and area in the list. Living in the UK, I used this BBC search tool to find the transmitter closest to my location.

Once you have chosen one, click Save and Next, to continue.

Channel scan Tvheadend Web Config

This will start scanning for channels operating on frequencies from the transmitter you selected. Let it run until progress reaches 100%, then press Save & Next .

The next menu will have options to map these services to channel names that can be understood by media players. Check the boxes for Map all services , Create provider tags and create network tags, before pressing Save and Next

Once you’ve done this, your Tvheadend installation should be complete, with channels matching the services broadcast in your area. Just click » Ready», to close the configuration popup.

Step 4: Stream or Record TV

With Tvheadend installed and configured, you can move on to the fun part — watching or recording TV. You can use Tvheadend to stream to media players like Kodi. to your phone or tablet using apps like Tvhclient, to your computer using VLC, or through the Tvheadend web portal itself.

If you want to quickly upload your channels to VLC for testing, type the following into your web browser to download the streaming playlist, replacing the username, password, and IP address with your own:

 http://username:password@YourIPAddress:9981/playlist/channels 

To record TV through the web portal, search for content in electronic program guide and click the first icon (with the «i» symbol) to display information about it.

Tvheadend Web Recording Popup

To record a show, select Program recording. Select » Record the series if you want to automatically record series episodes.

Record and stream Live TV to the whole house

Thanks to Tvheadend, you can get rid of expensive TV and streaming packages. Using your Raspberry Pi, you can stream multimedia content, whether live or pre-recorded, to all the devices in your home by cutting the cord forever.

Once your NVR is ready, it’s time to expand your media ambitions, so consider building your own media center PC. PC to stream your favorite TV shows and movies in style (no buffering). You can even build an Android TV box with your Raspberry Pi build an Android TV box with Raspberry Pi build a box to take advantage of popular Android streaming apps.

Похожие записи