HD HomeRun HDHR-T1-US on the Internet

I wrote an article in the past on how to get an HD Homerun Plus on the Internet

http://www.apolonio.com/node/54

It is a great device, it had built in h.264 encoding.  It's drawbacks were that it was more expensive and did overheat.  After a few months of use, mine died, I suspect due to overheating.

I did have the non h.264 version called an HDHR-US dual tuner version and I also found a single tuner one at Goodwill for less then $10.

The blue one on top is the Single tuner version the one on the bottom is the dual tuner version.

The problem with these HD Homerun Units is that you cannot directly stream these to the Internet.  It doesn't stream to another subnet on your network either.  They need to be on the same subnet as whatever you are recording with.

This is also true with the h.254 encoded PLUS version as well.

The plus version was easy, just proxy it using apache.  With these HDHR-US units, in addition to a proxy you have to encode it yourself.

You can put it all one one server, but I personally split it in to two servers, one web server, and one transcoding server.  I did this because I wanted to keep the encoding off of my web server.

 

#1 Build A Transcoding Linux Box

First Step is to build a Linux Transcoding Box

You can use almost any distribution that can run VLC and the HDHomeRun library, Popular distributions like Ubuntu and Debian should work.  I have not tested it on Raspbian, but I think Raspberry Pi's CPU may not be enough to transcode, and right now I did not research how to use the Pi's GPU to transcode, I have a feeling if this can be figured out, that would be the ideal way to go.  But the route I did decide to go with was a CentOS 6 64bit distro.

The hardware I am using will actually be a virtual machine on an ESXi server.  It will be on a VM that has 2 cores which run on Xeon 2.26Ghz processors, 2GB of RAM, 20GB of hard drive space.  The NIC I used was the VMXNET 3, but the switch that the HDHR connects to is 100MB, so I should be fine.

Build the linux box, no GUI needed

You will need to add a a third party repo to get VLC installed.

wget http://dl.atrpms.net/el6.9-x86_64/atrpms/stable/atrpms-repo-6-7.el6.x86_64.rpm

Then

yum install atrpms-repo-6-7.el6.x86_64.rpm

In the future, the above instructions may be obsolete, here is a link the their instructions

http://atrpms.net/documentation/install/

After that is installed, type 

yum install vlc

To summarize, you need a box powerful enough to transcode with linux installed and VLC added on.  

The version of vlc as of this writing that works with this document is

VLC media player 2.1.4 Rincewind

#2 Install The HD Homerun Library

You will need a the HD Homerun library from silicon dust.

Installation instructions are here

https://www.silicondust.com/support/linux/

Go to the link above to get the latest version but as of this writing

  1. wget http://download.silicondust.com/hdhomerun/libhdhomerun_20150826.tg
  2. tar zxvf libhdhomerun_20150826.tgz
  3. cd libhdhomerun
  4. make

There will be a lot of files in that directory, the one of interest is hdhomerun_config, you can copy it to a directory in your path like /usr/bin or /usr/local/bin but that will require root priviledges.  You can leave it where it is, but you will need to reference that path.

Now you can test to see if it can find the hdhomerun

hdhomerun_config discover

Remember that HDHR has to be on the same subnet

It should return the HDHR device number and its IP address, in this example we will use 1012345B

This command scans for available channels

hdhomerun_config 1012345B scan /tuner0

Here is how a discovered channel looks like

The 213000000 number is the channel, the PROGRAM number is the subchannel, and the value after the colon is the channel.

To tune to this channel you would use the commands

hdhomerun_config 1012345B set /tuner0/channel auto:617000000
hdhomerun_config 1012345B set /tuner0/program 3

Your tuner will be set to 13.1 KCPQ

Before you can send the stream to the linux transcoder box you have to turn on vlc to listen on UDP port 5000 and stream out the transcoded tream vi http tcp port.  In this example we will use 9000, this is all one line and you may want to run it in screen.  192.168.1.11 is the IP address of the eth0 on the Linux Transcoder, you can actually go to localhost and have apache feed out the data using the ProxyPass directive.

cvlc udp://@:5000 :sout="#transcode{vcodec=h264,vb=600,scale=0.5,deinterlace,fps=20,acodec=mp2a,ab=192,channels=2,venc=x264{keyint=20,bframes=0}}:standard{access=http,mux=ts,dst=192.168.1.11:9000}" -v

Tweak the transcode parameters based on your taste and bandwidth,

Now you can simply point VLC network stream to your transcoder box

http://192.168.1.11:9000

 

#3 Getting to It Remotely

At this point you can use similar instructions from the HDHR Plus document

http://www.apolonio.com/node/54

Couple cavaets though, you cannot change the channel or quality from the web page.

You will have to come with your own PHP script to call it