HDMI Extender Reverse Engineered

[danman] has been playing around with various HDMI video streaming options, and he’s hit on a great low-cost solution. A $40 “HDMI extender” turns out to actually be an HDMI-to-RTP converter under the hood.

He’d done work previously on a similar extender that turned out to use a quirky method to send the video, which he naturally reversed and made to do his bidding. But non-standard formats are a pain. So when he was given a newer version of the same device, and started peeking into the packets with Wireshark, he was pleasantly surprised to find that the output was just MPEG-encoded video over RTP. No hacking necessary.

Until now, streaming video over an IP network from an arbitrary HDMI output has been tricky, [danman] has been more than a little obsessed with getting it working on the cheap. In addition to the previous version of this extender, he also managed to get a stream out of a rooted Android set-top box. That costs a bit more, but can also record at the same time, should you need to.

None of this solves the HDMI HDCP encryption problem, though. You’re on your own for that one.

(Those of you Wireshark wizards out there will note that we just swiped the headline image from the previous version of the project. There were no good images for this one. Sorry about that.)

41 thoughts on “HDMI Extender Reverse Engineered

  1. if the hdmi hacker gnomes are listening Id love to see someone make a quad view multiplexer that takes 4 1080p hdmi inputs and outputs a 4k hdmi. Commercial units are like $1k+.

    1. Such a task would require either an ASIC (very expensive unless made in stupidly large volume production) or a fast and big FPGA with 5 HDMI ports (not sure if they even make this… maybe 2 of them with less ports) , it would not be that much cheaper…

      Why would you want to stitch together 4 HDMI streams anyway?

      1. Just a guess, but maybe a security camera display or possibly a PiP type of deal for watching sports. But until a cheap hackable product comes out it’s probably easier and cheaper to use a PC with a GPU or an accelerator to process the video stuff.

        1. It’s probably cheaper to take a 4K NVR, stream in 4x 1080 h264 IP streams and output 4K HMDI.
          $ channel unit without HD you’re talking circa $300 via china resellers and it’s designed to do that 247.
          Prices will come down rapidly over the next 12months.

      2. This shouldn’t be too difficult to do and not that costly. Use 4 Analog Devices HDMI receiver chips (non-HDCP, unfortunately), an Analog Devices HDMI transmitter chip, and an inexpensive Altera Cyclone IV or Cyclone V. The firmware would be fairly simple. I would guess some DDR would be needed as a frame buffer. Most (All?) Altera Cyclone FPGAs with transceivers (GX) don’t have enough of them onboard to pull off 5 HDMIs. Overall a pretty simple product. I mentioned this exact same product a year-or-so ago to management where I work, but it never went anywhere.

        1. At like what… 1 FPS.

          You’ll need at least DDR3 bandwidth just to read and write these streams to memory as a bare minimum… probably much more bandwidth if you don’t want to drop frames.

          Even a 2k stream is about 8GBps… you’ll need to be in the ballpark of 32GBps memory bandwidth to write and read back 4 1080p and 1 4k stream… without any considerations of overhead.

          Now once Altera releases FPGAs with onboard HBM/HBM2 then you’ll have enough bandwidth.

          1. Do what now? 1080p60 doesn’t take that much bandwidth, nor does 2k or 4k. Here’s some actual numbers… 1920 pixels wide * 1080 pixels high * 24bits of depth * 60 frames per second / 8 bits per byte = 373MB/s. That calculation is with no pixel subsampling, too. Multiply that by 4 (for writing of 4 1080p60 streams) to get 1492MB/s, then multiply by 2 (for reading the 4 streams, since a single 4K is equal to 4 1080p) to get 2984MB/s. Peak transfer rate of DDR2-400 is 3200MB/s. Those numbers seem to add up fine to me. A slightly faster DDR2 would make for more overhead. Even RAW 4k video at 8-bit 4:4:4 is under 2GB/s. There’s no way uncompressed 2k video is 64Gb/s.

      3. As you seem to have some knowledge on the subject, a quick question somehow related: what ‘d it take / how cheap ‘d it be to split an HDMI input into four HDMI outputs ( basically outputting top-left, top-right, bottom-left & bottom-right “rectangular sections” from the original video feed to four distinct screens ).
        I didn’t have a chance to have fun with FPGAs ( yet ? ), although I though maybe 4 of those could extract such “rectangular sections” & output those to a screen ( I’m not taking in account upscaling stuff here, so the resolution of each of the “rectangular sectons” ‘d be 1/4 the original input’s .. )

        -> if it can be done one the [quite]cheap, it’s a must have I can’t miss ;p

        1. I think going 1-to-4 would be about the same effort as going 4-to-1. Non-fancy video scaling would be easy as well. The hardest parts of the entire project is designing and building the hardware. As a one-off device, I don’t see it being cheap. HDCP could still be an issue, depending on the 4 sources.

          1. Thx for the quick reply ;)

            The current poc ‘d involve using SD cards as storage, and some cheap “movie player” boxes that have HDMI output.
            ( the video material is also totally ours :) )

            HDCP aside, any hint on the ideal BOM & pricing ( when sourcing for a one-ooff [ that may lead to [many] more [hopefully ? ^^ ] ] )
            Another idea, while not quite ideal, was to have a TV that offer a “zoom-in video source” capability ( set for each screen, this may allow to have only part of the original video feed actually visible on the screen, while the whole is still being sent – although not efficient at all / pretty hacky / not even sure, if such TV can be sourced, this may come as a quick hack )
            Thus, hint are more than welcome, I’ll digg the necessary stuff & do my best to come up with something :)

          2. It’s tough to say what the BOM cost might be… that’s not what I do day-to-day. We also get excellent pricing on FPGAs, so any numbers I’d generate internally would be unrealisticly low for most people.

            Here’s my attempt at a basic BOM… Altera Cyclone IV (EP4CE75), one Analog Devices ADV7612 HDMI Receiver, a DDR2 (the bigger the better), four Analog Devices ADV7513 HDMI Transmitters, proper power supplies for the FPGA/HDMI stuff, EPCS (25P28) to boot the FPGA, EEPROM (24LC128) for settings, more EEPROMs for EDID, maybe another DDR2 if you want to run Linux in a Nios II, maybe Ethernet or RS232 for remote control. There’s probably some things I’m missing.

            You’d definitely need a good PCB layout person… DDR and HDMI and Ethernet require specific PCB layout requirements and length matching, proper impedance and termination, etc.

            You might ping BlackMagic Design about their MultiView 16 and see if it can do what you’re looking for.

          3. 27MHz oscillator for video, 25MHz oscillator for Ethernet… forgot those. All other useful clocks can be PLL’d in the FPGA from those two base frequencies.

        2. Could you elaborate on what you’re trying to achieve? I have a suspicion that creating a PCB is probably the least best solution for your problem.. Unless it’s about the challenge / learning process then by all means go ahead :)

          1. sure ;)

            Some client’s partner tells me that he has a video feed ( actually, a video playing on a cheap movie player ) with 4 “views” on it, that has to be splitted for each “view” to be displayed on a separate TV using an HDMI cable ( he’s currently displaying the same content on each screen using a 1 to 4 HDMI splitter ), and he’s wondering what’d be the cheapest way to achieve that

            I already ordered some cheap “HD movie players” off ebay for my first thought: splitting the video beforehand, and just have to copy the stuff to some SD cards, read by some movie players, each with their controls tied up to a uC ( or maybe on plugging on the IR receiver signal line .. ) .. hoping that the videos played ‘d be “in sync” ( if we have the “exact” same TV / SD cards / movie players .. hopefully ? .. or at least a constant one, to beware of when preparing the video content ).

            Now, aside from playing videos, I’d like a setup that ‘d act as an RPi in kiosk mode ( booting on a logo, then no bootlogs, then somewhere where I can run WebGL stuff & interact with the GPIOs – presumably chromium ? ) .. but able to send different outputs to 4 screens connected over HDMK
            => if achieved, I could do Three.js stuff on 4 screens at once, which ‘d be even more awesome ( for me / my needs, at least ^^) if controlled with some custom controller(s)
            ( to do the above “on the cheap”, I thought of using 4 Pi’s & controlling them via serial or I2C to send commands to the server running on each that ‘d be passed & parsed by the app/game running on Chromium,to then update the screens to reflect the suer’s actions & stuff ;) )

            so,
            – one of the reason is the challenge & learning new stuff ( those FPGAs .. )
            – the other reason is .. this ‘d be pretty neat / usefull ( if there are none not-overkill devices out there to handle precisely that .. somehow cheaply ? :/ .. ) :D

            what do you think ?

        3. A simple solid solution to your problem sounds like a PC with 4 HDMI ports. They can be mirrored or split. Then use a software video player stretched across all four desktops. I have already done this with 2 screens on a $600 computer with no issues.

          1. Yes, it seems indeed like the more robust setup ( yet quite pricy :/ ) ;)
            The video stretched across the desktops is a simple yet effective solution, and it wouldn’t be that difficult for me to handle multiple windows for custom apps instead of only displaying video later on ( .. )
            I’ll see if I can find an “all-in-one” with a video card that has the necessary :)

        1. That would require the video be encoded first. HDMI is uncompressed. It may be low depth or sub-sampled, but still uncompressed.

          Four channels of good quality, real-time (low-latency), 1080p video is not necessarily cheap.

          1. I see what you did there. I said good quality, though. You said yourself there’s truncation/scaling going on.

            An RTP-to-HDMI MultiViewer (4 RTP streams decoded to a single 4k output) might be a fun box to make.

    2. Check out the HDS 841SL. It’s a quad viewer that takes 4 1080p and outputs one. It also can display all four signals at the same time. Not quite 4k but pretty close to what you want to do for under $300. Only catch? There’s no setting to my knowledge where the screen is shared equally. Might make for a good hack.

      1. Never heard of that brand before. Looks like they have some neat gear we could use at work.
        Looks like a lot of their stuff is SDI… too bad that’s not really consumer friendly. I also don’t see any 4k support, though.

        Blackmagic Design makes the MultiView 4, which performs the function the OP needs, is $500 and supports 4k, but again, only has SDI inputs.

        1. Yeah…seen both of these. Id really like to avoid doing 4 hdmi to sdi before the 4k stitch. SPLITMUX-4K-4RT is exactly what I need but not exactly what Id like to pay at $1600. Im really surprised that 4k screens dont have 4 1080 hdmi inputs and this function built in.

  2. I need an HDMI pass thru type of device which will also break-out the audio to L-R RCA jacks, provide VGA output, as well as composite video to an RCA jack. (Essentially, HDMI in, HDMI+VGA+CVBS+L-R out). Nobody makes this in a single unit (that I have found). To get this type setup now, I’d have to kludge together various splitters and converters. This is for mobile DJ/Karaoke host use, so space is at a premium and the multiple unit option would take too much of it.

      1. I can find any number of units to convert the HDMI signal to any single analog output (eg; VGA, or CVBS) but I am not able to come up with a unit that will output ALL of the formats at the same time, which is what I am looking for. As a mobile DJ/Karaoke host, it is helpful to be able to put a video signal to a venue owned display mounted on the wall as well as my own singer lyrics screen. Having the flexibility to output all of the most common video signals (HDMI + VGA + Composite) means that I am not limited to where I can show videos at any particular venue.

      1. Sometimes encoders require resolutions to be multiples of macroblock sizes. For example, an MPEG2 encoder may bring in 1920×1088 because both 1920 and 1088 are evenly divisible by 16 (MPEG2 macroblock size). That *might* explain the 1728, but not the 1090. One of the encoders I’ve worked on would add 8 lines of black pixels at the bottom of the image to pad to 1088 before running the video through the FPGA-based encode engine.

  3. Looks like the blog post about the HDMI extenders has been updated. New firmware has been located that allows more settings to be changed from a web interface. Apparently this firmware also outputs a more correct resolution of 1920×1090. It’s not mentioned if the extra pixels are just padding.

Leave a Reply to JimCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.