Record TV on Raspberry Pi with tvheadend

Posted by Mike Redrobe | Posted in Technology | Posted on 07-06-2014

0

RpiI’ve had PC running Windows Media Center for a couple of years recording TV, but decided to replace it with – you guessed it – a Raspberry Pi!

The MCE box was using a couple of these gold Kworld USB dual tuners (UB499-T2):
kworld-ub499--t2

On connecting one to the Pi, initially nothing showed up in /dev/dvb, so I had to download the firmware to get it working:

wget http://dl.dropbox.com/u/32904843/dvb-usb-it9137-01.fw
sudo cp dvb-usb-it9137-01.fw /lib/firmware

Next, fetch some required tools:

sudo apt-get update
sudo apt-get install unzip libcurl4-openssl-dev pkg-config git build-essential dvb-apps

Download and compile tvheadend:

git clone https://github.com/tvheadend/tvheadend
cd tvheadend
./configure
make
sudo make install

(takes about 5 mins)

Start tvheadend server with a blank password:

tvheadend -C

The rest of the configuration can now be done through your web browser, pointed at port 9981 of the raspberry pi’s ip address:
http://192.168.1.35:9981

Select your tuners from Configuration / DVB Inputs/ TV adapters, and click the enable checkbox for each one:

choose-tuners

Now goto the Networks Tab and click Add to create a new network

choose-dvb
(DVB-T for freeview)

Tvheadend has a list of transmitter to speed up the scan process, you can find your local transmitter by typing your postcode into http://www.ukfree.tv/transmitters.php

choose-transmitter

Give it a name (e.g. “freeview”), and click create.

Click the Muxes tab, and after a while, you should see channels (“services”) detected in the right hand column below:

muxes-display

Now it has scanned the channels, you can add them into the lineup, click on services, and then “Map-all”:

map-channels

I had to click play on one of the channels before the EPG would populate, but that may have just been a matter of waiting:

epg

Now you can browse the EPG, and record shows.

An hour long TV show takes around 1GB of space, so SD card storage would fill up quite quickly if left like that, I use an attached 2TB USB HDD, just change the location in Configuration / Recording / Digital Video Recorder / Recording System Path:
/media/usb/TV

To start tvheadend on bootup, add the following to /etc/rc.local before the exit 0 line:
/user/local/bin/tvheadend -f -u pi -g pi