{"id":575,"date":"2014-06-07T10:52:52","date_gmt":"2014-06-07T10:52:52","guid":{"rendered":"http:\/\/www.redrobe.com\/mike\/?p=575"},"modified":"2014-06-07T10:52:52","modified_gmt":"2014-06-07T10:52:52","slug":"record-tv-on-raspberry-pi-with-tvheadend","status":"publish","type":"post","link":"https:\/\/redrobe.com\/mike\/record-tv-on-raspberry-pi-with-tvheadend\/","title":{"rendered":"Record TV on Raspberry Pi with tvheadend"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.redrobe.com\/mike\/wp-content\/uploads\/2014\/06\/Rpi.png\" alt=\"Rpi\" width=\"161\" height=\"128\" class=\"alignright size-full wp-image-597\" \/>I&#8217;ve had PC running Windows Media Center for a couple of years recording TV, but decided to replace it with &#8211; you guessed it &#8211; a Raspberry Pi! <\/p>\n<p>The MCE box was using a couple of these gold Kworld USB dual tuners (UB499-T2):<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.redrobe.com\/mike\/wp-content\/uploads\/2014\/06\/kworld-ub499-t2.png\" alt=\"kworld-ub499--t2\" width=\"128\" height=\"128\" class=\"aligncenter size-full wp-image-585\" \/><\/p>\n<p>On connecting one to the Pi, initially nothing showed up in \/dev\/dvb, so I had to download the firmware to get it working:<\/p>\n<p><code>wget https:\/\/github.com\/OpenELEC\/dvb-firmware\/raw\/master\/firmware\/dvb-usb-it9135-01.fw<\/code><\/p>\n<p>Next, fetch some required tools:<\/p>\n<p><code>sudo apt-get update<br \/>\nsudo apt-get install unzip libcurl4-openssl-dev pkg-config git build-essential dvb-apps<\/code><\/p>\n<p>Download and compile tvheadend:<\/p>\n<p><code>git clone https:\/\/github.com\/tvheadend\/tvheadend<br \/>\ncd tvheadend<br \/>\n.\/configure<br \/>\nmake<br \/>\nsudo make install<\/code><\/p>\n<p><em>(the above takes about 5-10 mins on a Pi model B)<\/em><\/p>\n<p>Start tvheadend server with a blank password:<\/p>\n<p><code>tvheadend -C<\/code><\/p>\n<p>The rest of the configuration can now be done through your web browser, pointed at port 9981 of the raspberry pi&#8217;s ip address:<\/p>\n<p><code>http:\/\/192.168.1.35:9981<\/code><\/p>\n<p>Select your tuners from Configuration \/ DVB Inputs\/ TV adapters, and click the enable checkbox for each one:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.redrobe.com\/mike\/wp-content\/uploads\/2014\/06\/choose-tuners.png\" alt=\"choose-tuners\" width=\"902\" height=\"323\" class=\"aligncenter size-full wp-image-578\" \/><\/p>\n<p>Now goto the Networks Tab and click Add to create a new network <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.redrobe.com\/mike\/wp-content\/uploads\/2014\/06\/choose-dvb.png\" alt=\"choose-dvb\" width=\"644\" height=\"304\" class=\"aligncenter size-full wp-image-576\" \/><br \/>\n(DVB-T for freeview)<\/p>\n<p>Tvheadend has a list of transmitter to speed up the scan process, you can find your local transmitter by typing your postcode into <a href=\"http:\/\/www.ukfree.tv\/transmitters.php\" target=\"_blank\" rel=\"noopener\">http:\/\/www.ukfree.tv\/transmitters.php<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.redrobe.com\/mike\/wp-content\/uploads\/2014\/06\/choose-transmitter.png\" alt=\"choose-transmitter\" width=\"640\" height=\"607\" class=\"aligncenter size-full wp-image-577\" \/><\/p>\n<p>Give it a name (e.g. &#8220;freeview&#8221;), and click create.<\/p>\n<p>Click the Muxes tab, and after a while, you should see channels (&#8220;services&#8221;)  detected in the right hand column below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.redrobe.com\/mike\/wp-content\/uploads\/2014\/06\/muxes-display.png\" alt=\"muxes-display\" width=\"661\" height=\"352\" class=\"aligncenter size-full wp-image-581\" \/><\/p>\n<p>Now it has scanned the channels, you can add them into the lineup, click on services, and then &#8220;Map-all&#8221;:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.redrobe.com\/mike\/wp-content\/uploads\/2014\/06\/map-channels.png\" alt=\"map-channels\" width=\"644\" height=\"480\" class=\"aligncenter size-full wp-image-580\" \/><\/p>\n<p>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:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.redrobe.com\/mike\/wp-content\/uploads\/2014\/06\/epg.png\" alt=\"epg\" width=\"631\" height=\"492\" class=\"aligncenter size-full wp-image-579\" \/><\/p>\n<p>Now you can browse the EPG, and record shows.<\/p>\n<p>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:<br \/>\n<code>\/media\/usb\/TV<\/code><\/p>\n<p>To start tvheadend on bootup, add the following to  \/etc\/rc.local before the exit 0 line:<br \/>\n<code>\/user\/local\/bin\/tvheadend -f -u pi -g pi<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve had PC running Windows Media Center for a couple of years recording TV, but decided to replace it with [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-575","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/redrobe.com\/mike\/wp-json\/wp\/v2\/posts\/575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redrobe.com\/mike\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redrobe.com\/mike\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redrobe.com\/mike\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/redrobe.com\/mike\/wp-json\/wp\/v2\/comments?post=575"}],"version-history":[{"count":0,"href":"https:\/\/redrobe.com\/mike\/wp-json\/wp\/v2\/posts\/575\/revisions"}],"wp:attachment":[{"href":"https:\/\/redrobe.com\/mike\/wp-json\/wp\/v2\/media?parent=575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redrobe.com\/mike\/wp-json\/wp\/v2\/categories?post=575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redrobe.com\/mike\/wp-json\/wp\/v2\/tags?post=575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}