
Cheap HDMI capture for Linux - benjojo12
https://blog.benjojo.co.uk/post/cheap-hdmi-capture-for-linux
======
jamesfmilne
You can also use devices that are USB Video Class (UVC) compliant, thus which
don't require any drivers.

libuvc can be used to capture from these devices:
[https://github.com/ktossell/libuvc](https://github.com/ktossell/libuvc)

You can get cheap off-brand UVC USB grabbers, or you can get higher quality
gear, like the AJA U-TAP:

[https://www.aja.com/en/products/u-tap](https://www.aja.com/en/products/u-tap)

Admittedly though I haven't seen anything that comes close to £45 :-)

~~~
gcb0
there's a reason the Starts with "cheap".

all solutions so far cost well over what most people paid for their computers
or TVs.

there was pro composite capture under 200 for a long time. and cobsumer ones
for 30ish. and thats dealing with analog. hdmi without DRM should produce even
cheapers devices, but yeah, everyone has to embrace DRM to name it hdmi

~~~
djsumdog
The UVC one mentioned looks to be in the ~$400 USD price range, which is a far
cry from the $800 stuff the article author looked at, but it's still more
expensive than the <$100 solution presented.

Was that $300~$400 worth the time needed to reverse engineer the cheaper
solution? It's all about tradeoffs really. At least it's open source so other
people can use it now without the time involved. Also if you need to read in
from 5 ~ 10 cameras, the cost can grow very quickly.

~~~
jamesfmilne
If you want to save cash you can try your luck on AliExpress.

Here's a device that looks a lot like the Magewell USB 3 UVC HDMI grabber for
$118 (with free shipping):

[http://www.aliexpress.com/item/Free-Shipping-XI100D-UVC-
USB3...](http://www.aliexpress.com/item/Free-Shipping-XI100D-UVC-
USB3-0-1080P-60FPS-HDMI-Capture-Dongle-USB-Capture-HDMI-High-
Quality/32617673961.html?spm=2114.40010708.4.8.liA3eN)

~~~
sigio
I just bought that device 2 weeks ago... and tried it, but so far haven't
gotten any video out of it under Linux or Windows.

~~~
jamesfmilne
They certainly seem a bit confused about what kind of USB 3 connector they are
meant to put on their box!

------
tveita
The output image uses Rec. 709 R’G’B’ components, where the darkest value is
16 and the brightest is 235, which is why the colors look washed out. It would
be fair to convert back to the original color space for the comparison.

[https://en.wikipedia.org/wiki/Rec._709](https://en.wikipedia.org/wiki/Rec._709)

------
SoapSeller
Cool hack, but the part about the cost of off-the-shelf solutions is wildly
wrong - Blackmagic's HDMI capture solutions can be purchased for less than
145usd for pci-e and 200usd for usb3 and they have free drivers&sdk for linux.

~~~
kevingadd
The reason why Blackmagic hardware is cheaper is that it's rubbish. Bad
hardware, bad firmware, bad drivers. Everyone I know that's ever owned
Blackmagic (myself included) has had a bad time. It's not worth buying from
them just to save a hundred dollars.

~~~
KaiserPro
Yup. but not as bad a RED hardware.

I've personally seen 4 red rockets die. considering the price at the time, for
what was basically a glorified jpeg2000 decoder, it was bollocks.

------
NegativeK
A not cheap, but fully open source (hardware and firmware) solution also
exists.
[https://github.com/timvideos/HDMI2USB](https://github.com/timvideos/HDMI2USB)

------
0942v8653
What about HDMI DRM? Does it break it (illegal) or fail when it is used?

~~~
benjojo12
This device happily decodes HDCP. I figured the manufacturer does not care

~~~
phkahler
>> This device happily decodes HDCP.

If used as intended will it allow an HDCP source to show on a non-HDCP
display? Because stupid AppleTV won't allow "protected" content to display on
mt main TV because it doesn't support HDCP, and if you buy something on iTunes
you don't find out until you've already purchased it. DRM is driving me away
from services like that and I'd rather just stop using them than buy another
TV.

~~~
icebraining
You're probably better off buying an HDMI-in/out device like [1]. It's a
"splitter", but you can just plug the HDMI-in in one side and one HDMI-out in
the other, and since it doesn't enforce HDCP on the output, it works as a
stripper.

[1] [https://www.amazon.com/ViewHD-Powered-
Splitter-1080P-Model/d...](https://www.amazon.com/ViewHD-Powered-
Splitter-1080P-Model/dp/B004F9LVXC)

------
spilk
This is effectively a lossy capture though, since the HDMI->IP converter is
re-encoding the video to MJPG before transmitting it.

Hard to beat for the price, though

------
rsync
"These units are not perfect for quality, however they are not bad at all,
Here is a screenshot taken on my laptop..."

I am confused by this ... HDMI is a digital interconnect and deals in digital
I/O ... in my mind, if you succeed in capturing that HDMI, the resulting
stream should be _identical_ ... why would there be a quality (or any other)
difference ?

~~~
riskable
Because they compress the video before sending it over IP. Nothing fancy, just
M-JPEG which is basically the same thing as taking a screenshot of the video
every nth of a second and saving it as a high-quality JPEG (probably around
95% quality rating).

The screenshot in the video suggests 1000fps but that figure is highly
dubious. It is much more likely to be 30 or 60fps on a cheap HDMI->IP
converter like this.

~~~
ambrop7
1000fps, what the hell? HDMI only supports up to 60fps (which makes sense
considering the intended use is sending video to a display device like
monitor/tv/projector).

------
dharma1
I wish there was something that worked on Android for HDMI input. Would be
great to be able to repurpose tablets as external/field monitors. Some UVC
dongles work, but I haven't seen any low cost 1080p ones

~~~
gcb0
theres a whole lot of camera monitors for pro video that would die that day.

------
gm-conspiracy
How would one go about compressing the captured stream?

I read it can be containerized as an MKV, but then would you re-encode as
H.264, or is there a better codec?

I assume there is a quality vs time to encode trade-off?

Also, would this be a component in a viable DIY HDMI matrix switch?

I see this 4 input / 8 output 4K HDMI matrix switch for only $169 on Amazon
here: [http://amzn.to/28Ykyor](http://amzn.to/28Ykyor)

So, cost-wise not viable, but I like the idea of having more programmatic
control of the switch.

~~~
dsr_
Use any codec scheme you like. ffmpeg and mencode are the usual suspects, or
Handbrake if you like GUIs to help you along.

Realtime encoding is within the reach of some schemes on some processors.

~~~
gm-conspiracy
_Realtime encoding is within the reach of some schemes on some processors._

Can you elaborate on that?

What sort of setup (hw/sw) would one need to make this viable (realtime
encoding from the stream)?

~~~
drothlis
Intel GPUs + VAAPI
([https://01.org/linuxgraphics/community/vaapi](https://01.org/linuxgraphics/community/vaapi))
can easily do H.264 encoding in real time.

P.S. See also
[https://trac.ffmpeg.org/wiki/HWAccelIntro](https://trac.ffmpeg.org/wiki/HWAccelIntro)

------
hacker42
Are the gamer HDMI capture devices expensive because they have a low latency?
(Besides the verticality of the market.)

~~~
warmwaffles
Any capture devices you know that are decent? I've been toying with getting
one to do demos.

~~~
georgemcbay
I use the AVerMedia Game Capture HD 2 to capture HDMI from Xbox One and PS4
and I've been very happy with it.

Unlike a lot of such devices this one is stand-alone, I don't plug it into a
PC, I just use it as an HDMI pass-through, plug a USB3 external hard-drive
into it (it also has a bay for internal 2.5 SATA HDD, but I use an external
drive so I can just pull that out of the capture device, plug it into a
computer to get the captured mp4 files over quickly and easily for editing).

The stand-aloneness of this device is pretty great because it means you don't
need to muck around with drivers on your other computers, though YMMV
depending upon specific usage, a lot of people like to do live streams
directly to places like twitch and this device isn't really well suited for
that sort of thing.

Also, this device (AFAIK) doesn't do HDCP pass through. Game systems generally
don't enable HDCP during gaming (but do during, say, blu-ray playback). So
that certainly makes it less flexible than solutions which will allow HDCP
capture.

------
z02d
Off-Topic but somehow related: I was thinking about to use my iDevices as
generic HDMI-Displays.

The afaik best app for doing this is Duet Display [1], if you want to use
Mac/Win. But I want to use it for a Raspberry Pi for example. Duet display
streams the display information to the own application via ethernet over
lightning port.

HDMI itself is also some network protocol (dangerous superficial knowledge).
Theoretically it should be possible to build a small device, which translates
hdmi video/audio to the same kind of network via lightning port as duet and
display?

What do you think? Do you see any pitfalls there, which I don't see?

[1] [http://www.duetdisplay.com/](http://www.duetdisplay.com/)

------
vmsplice
How is the latency with something like this? I would assume it's pretty much
real time when dealing with the raw data, encoding could add some latency. Am
I correct?

~~~
benjojo12
Most of the latency comes from internal buffering inside ffmpeg or vlc. Most
go away if you tune them down.

------
samtho
This quite interesting, I've been toying with building a capture box myself
for presentation/gaming streaming and recording. It takes two inputs: HDMI-in
from monitor, and HDMI/Other Digital for the camera, and one output: HDMI out
back to the monitor. It can be configured to record to its internal SSD or
stream (to popular streaming sources). I run a meetup and would love an easy
way to record talks, there isn't much out on the market currently which is
unfortunate. I'm really happy to see stuff like this surface in the OSS world.

------
breakingcups
That's a brilliant solution actually. Nicely out of the box.

------
pkaye
What is the purpose of something like this?

~~~
exar0815
Capture of HDMI Video via Network, driverless, on any OS that is able to
accept a Video Stream.

------
jandrese
Does this work with encrypted video? The sample image came from an unencrypted
source, but it seems like a big violation of the HDMI spec if these IP
extenders strip the HDCP off before blasting the data over an IP network.

This could be a rather major caveat to this solution if it only works on
unencrypted sources.

------
late2part
I love reading these. I always wonder if the original
hardware/software/firmware engineer reads this and goes:

    
    
      A. Well, Duh!
      B. Well played reverse engineering Sir!
      C. Oh no, I need to do better next time!

~~~
lfowles

        D. I hope management doesn't see this...

------
beagle3
This is awesome. I was just thinking about something that could be even more
awesome: if someone produced an HDMI to MIPI CSI adapter - that would allow
e.g. a RasPI to have an "HDMI in" port.

------
Marioheld
What are the minimum hardware specifications for reading the ip data? Would it
for example work with an raspberry Pi or is the arm cpu and the 100 mbit
network adapter to slow?

------
patja
Can it capture a 5.1 AC3 audio stream along with the video?

~~~
pests
I don't know the details, but this is from the article:

"[...] by default it will output matroska, aka mkv with both video and audio
so that it can be easily interfaced with (no compression happens in this
stage, just containerisation).

------
rasz_pl
original source of research 25. January 2014: [https://blog.danman.eu/reverse-
engineering-lenkeng-hdmi-over...](https://blog.danman.eu/reverse-engineering-
lenkeng-hdmi-over-ip-extender/)

new version producing ordinary h264, can stream directly to YT/twitch

[https://blog.danman.eu/new-version-of-lenkeng-hdmi-over-
ip-e...](https://blog.danman.eu/new-version-of-lenkeng-hdmi-over-ip-extender-
lkv373a/)

