• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Numeric TV recorder/broadcaster (DVB-T) with HTS Tvheadend  (Read 7086 times)

Karma: 0
Posts: 30

View Profile
« on: March 11, 2011, 06:06:54 AM »

I now have a private TV recorder on my sheevaplug, that also can broadcast the live TV through the network.

On the hardware side, I plugged a USB DVB-T adapter (I used an AVerTV Volar Black HD : http://www.avermedia.com/avertv/Product/ProductDetail.aspx?Id=460). I use a SDHC card (32GB) for the OS and the storage.
On the software side, I installed hts tvheadend (http://www.lonelycoder.com/hts/tvheadend_overview.html). It has a great web interface where you can configure your channels, watch them, and schedule recordings based on a program guide. All this can be used with my XBMC media-center frontend (on another computer) : it supports the htsp protocol for the live broadcasts of tvheadend, and the recordings can be accessed throught FTP (or any protocol you like : SMB etc)

For those who would be interested to setup something similar, here are the main steps I had to follow :
- I installed debian Squeeze as the operating system, but I suppose other versions/distributions should also work
- For the USB adapter to be recognized, I had to compile and install v4l-dvb, then modprobe dvb-usb-af9015 (this should be a different module if you have a different adapter). The firmware has to be copied manually in /lib/firmware (I took it from http://linuxtv.org/wiki/index.php/DVB-T_USB_Devices). In my case, I also added an option "options dvb-usb-af9015 remote=-1" for modprobe, but I'm not sure it is necessary
- HTS tvheadend has debian repositories, but only for x86 and amd64 architectures. So I had to compile it myself. Just download the source code (I used version 2.12), configure with "./configure --cpu=armv4t --release --disable-avahi" and make. After that, you can launch tvheadend from the command-line, and start playing with it
- tvheadend can grab the electronic program guides from the Internet, through xmltv. You have to install the package xmltv, then to configure it with tv_grab_xx --configure (replace the xx with your country code)
- To install tvheadend as a service, I copied the /etc/init.d/tvheadend file from the x86 .deb package, created a symlink of the executable to /usr/bin, installed the service (update-rc.d tvheadend defaults >/dev/null), created a /home/hts directory, created a hts user (adduser --system --group --shell /bin/bash --home /home/hts hts), and copied the .hts and .xmltv directories in /home/hts. Maybe there is a simpler way to do it...

The whole thing consumes 4.7W when idle, and less than 1% of CPU. Of course, you can install other services on the same machine.
While recording, it consumes 4.9W, and less than 10% of CPU. It dumps the audio/video stream as it is : no realtime transcoding. Some post-processing can be launched by tvheadend but I did not try it (I suppose we should not expect miracles because of the computing power of the sheevaplug)

One last remark : the xmltv grab duration might depend on the country/implementation. In my country, it is veeeery slow : around 8 hours to complete it. It is partly due to delays in the implementation itself (it tries not to overload the web site that is crawled), and partly due to the CPU power it needs (it takes between 30 and 80% of the CPU during these 8 hours). For that reason, I only grab every 4 days (96 hours)

On the whole, I'm very happy with this setup : it's stable, I can schedule the recordings through the Internet, I can watch TV or recordings with XBMC, it consumes less than 5W etc.
I also like the "geeky" parts, like being able to automatically schedule recordings based on regular expressions.
There are a few minor problems, but I did not investigate much on them :
- The program guides that come with the stream itself have problem with accents (I suppose there's an encoding issue somewhere : either in the firmware, v4l-dvb or tvheadend)
- The recordings can not always be downloaded through the web interface (only the small ones). Anyway, I prefer accessing them through FTP
- Some channels use EAC3 audio codec in my country, which is not very common : many OS/media players do not support it. Anyway, XBMC does :-)
- Timeshifting does not work well : that's normal (see tvheadend documentation)
- You can not record a channel and watch another one (except if you have a double tuner adapter)

Pages: [1]
Jump to: