I spend a lot of days each year away from home. To keep up on TV (directv), I have a Slingbox. But lately it just disconnects every few minutes and it is exceedingly frustrating. There are no superior placeshifting products out there that I can find, so I decided to put together my own.
To do this, you really need two things: An IR blaster to control a set-top-box, and a device to capture and stream HD video over IP.
The IR blaster turned out to be easy. I used an iTach: http://www.globalcache.com/products/itach/
The iTach has a powerful API and is controlled by TCP/IP so I was easily able to bend it to my will.
The HD capture was more of an adventure.
The adventure:
First, I tried an HDMI capture card, because my brother already had one that integrates with directshow. After a lot of tries, I was able to get VLC to open the audio and video, then transcode it for network transfer. But the latency was a sad 6+ seconds and a lot of frames got dropped, ruining the video. I don't know what to blame here, but my brother got tired of my screwing around with his computer and I had to stop
So the next thing I tried was an $80 HDMI extender that takes HDMI input and multicasts PCM audio and JPEG frames at about 90 Mbps over IP (what a great way to ruin your network performance!). In fact the packets are even malformed so a lot of high level socket libraries can't read the data correctly. I spent several days tinkering with this, with help from this blog: https://danman.eu/blog/reverse-engineering-lenkeng-hdmi-over-ip-extender/ In the end I was able to capture the video and audio from it, then transcode this in FFMPEG to h264/aac. Total latency ended up between 1 and 4 seconds depending on what kind of optimizations I applied to the x264 encoding in ffmpeg. Unfortunately, there were two problems. This device struggles to keep up just 25 FPS at 1080p, and the audio goes out of sync and continually shifts around in relation to the video even at 720p.
Then I discovered this fancy little box: http://www.auvidea.com/index.php/theme-styles/2013-06-22-21-23-36/encoder-e110 It takes HDMI input and outputs an h264/RTSP stream just like an IP camera! Exactly what I need! They even claim latency is as low as 100 ms. Problem was, it would cost close to $370 not including shipping from Germany to the USA, and for all I know there would be a surprise import duty as I have never ordered anything from Germany before. Either way, too expensive.
The eventual solution:
Finally, I looked on aliexpress to see if the Chinese were selling a comparable device. To my surprise, I found one for just $200 plus shipping:
"MPEG-4 AVC/H.264 HDMI Encoder Replace HD Video Capture Card"
from seller: Unisheen Tech Store
http://www.aliexpress.com/snapshot/6401297143.html
I complained to the seller about the high shipping charge ($65 for EMS) and he agreed to ship it DHL for $35, so $235 total. Much better. So I ordered one last week and today it arrived. I am pleased to say my search is done. This thing works brilliantly. HDMI in, H264/AAC out (over RTSP or HTTP or RTMP). There are no problems with audio sync. I can get reliable 1080p@30fps video to VLC with about 2 seconds latency over LAN, using the HTTP output method and without even reducing VLC's network caching from the default of 1000 ms. I can get latency down to under half a second with some settings tweaks, though this introduces a lot of dropped frames. I am more than happy with 2 seconds and I bet it will work great with less than 4 seconds latency over WAN/VPN.
The contrast and color accuracy are poor out-of-the-box but there are brightness, contrast, hue, and saturation settings in the web interface that can greatly improve things. They were all set to 50 by default. So I loaded up the same monitor calibration image on my PC and on the source HDMI device (also a PC) and got to work at making the "input" and "output" match, using ColorPix to precisely measure on-screen colors. I ended up setting brightness to 35, contrast to 60, and saturation to 70. Hue stays at 50. This fixes the contrast and brightness so that the shades of gray don't get shifted around by more than ~1 brightness level and the colors are considerably more accurate. Still not perfect, but good enough for me and the limited adjustments available. One important thing to note is that I enable full dynamic range in my Nvidia control panel's video color settings. Otherwise VLC displays a limited 16-235 range instead of the full 0-255.
To do this, you really need two things: An IR blaster to control a set-top-box, and a device to capture and stream HD video over IP.
The IR blaster turned out to be easy. I used an iTach: http://www.globalcache.com/products/itach/
The iTach has a powerful API and is controlled by TCP/IP so I was easily able to bend it to my will.
The HD capture was more of an adventure.
The adventure:
First, I tried an HDMI capture card, because my brother already had one that integrates with directshow. After a lot of tries, I was able to get VLC to open the audio and video, then transcode it for network transfer. But the latency was a sad 6+ seconds and a lot of frames got dropped, ruining the video. I don't know what to blame here, but my brother got tired of my screwing around with his computer and I had to stop

So the next thing I tried was an $80 HDMI extender that takes HDMI input and multicasts PCM audio and JPEG frames at about 90 Mbps over IP (what a great way to ruin your network performance!). In fact the packets are even malformed so a lot of high level socket libraries can't read the data correctly. I spent several days tinkering with this, with help from this blog: https://danman.eu/blog/reverse-engineering-lenkeng-hdmi-over-ip-extender/ In the end I was able to capture the video and audio from it, then transcode this in FFMPEG to h264/aac. Total latency ended up between 1 and 4 seconds depending on what kind of optimizations I applied to the x264 encoding in ffmpeg. Unfortunately, there were two problems. This device struggles to keep up just 25 FPS at 1080p, and the audio goes out of sync and continually shifts around in relation to the video even at 720p.
Then I discovered this fancy little box: http://www.auvidea.com/index.php/theme-styles/2013-06-22-21-23-36/encoder-e110 It takes HDMI input and outputs an h264/RTSP stream just like an IP camera! Exactly what I need! They even claim latency is as low as 100 ms. Problem was, it would cost close to $370 not including shipping from Germany to the USA, and for all I know there would be a surprise import duty as I have never ordered anything from Germany before. Either way, too expensive.

The eventual solution:
Finally, I looked on aliexpress to see if the Chinese were selling a comparable device. To my surprise, I found one for just $200 plus shipping:
"MPEG-4 AVC/H.264 HDMI Encoder Replace HD Video Capture Card"
from seller: Unisheen Tech Store
http://www.aliexpress.com/snapshot/6401297143.html
I complained to the seller about the high shipping charge ($65 for EMS) and he agreed to ship it DHL for $35, so $235 total. Much better. So I ordered one last week and today it arrived. I am pleased to say my search is done. This thing works brilliantly. HDMI in, H264/AAC out (over RTSP or HTTP or RTMP). There are no problems with audio sync. I can get reliable 1080p@30fps video to VLC with about 2 seconds latency over LAN, using the HTTP output method and without even reducing VLC's network caching from the default of 1000 ms. I can get latency down to under half a second with some settings tweaks, though this introduces a lot of dropped frames. I am more than happy with 2 seconds and I bet it will work great with less than 4 seconds latency over WAN/VPN.
The contrast and color accuracy are poor out-of-the-box but there are brightness, contrast, hue, and saturation settings in the web interface that can greatly improve things. They were all set to 50 by default. So I loaded up the same monitor calibration image on my PC and on the source HDMI device (also a PC) and got to work at making the "input" and "output" match, using ColorPix to precisely measure on-screen colors. I ended up setting brightness to 35, contrast to 60, and saturation to 70. Hue stays at 50. This fixes the contrast and brightness so that the shades of gray don't get shifted around by more than ~1 brightness level and the colors are considerably more accurate. Still not perfect, but good enough for me and the limited adjustments available. One important thing to note is that I enable full dynamic range in my Nvidia control panel's video color settings. Otherwise VLC displays a limited 16-235 range instead of the full 0-255.