Capture Device Firmware Hack Unlocks All The Pixels

According to [Mike Walters], the Elgato Cam Link 4K is a great choice if you’re looking for a HDMI capture device that works under Linux. But the bad news is, it wouldn’t work with any of the video conferencing software he tried to use it with because they expect the video stream to be in a different pixel format. For most people, that would probably have been the end of the story. But you’re reading this on Hackaday, so obviously he didn’t give up without a fight.

Early on, [Mike] found there was a software workaround for this exact issue. The problem isn’t that the Elgato can’t generate the desired format, it’s that the video conferencing programs just don’t know how to ask it to switch modes. The software fix is to create a dummy Video4Linux device and use that to change the format in real-time using ffmpeg. It’s a clever trick if you’ve got a conference call coming up in a few minutes, but it does waste CPU resources and adds some unnecessary hoop jumping.

Putting the device into bootloader mode.

Inspired by the software fix, [Mike] wondered if there was a way he could simply force the Elgato to output video in the desire format by default. He found a firmware dump for the device online, and found where the pixel formats were referenced by searching for their names in ASCII with hexdump. Looking through the source for the Linux USB Video Class (UVC) driver, he was then able to determine what the full 16 byte sequence should be for each video mode was so he could zero out the unwanted ones. Then it was just a matter of flashing his modified firmware back to the hardware.

But there was a problem: with the modified firmware installed, the device stopped working. After investigating the obvious culprits, [Mike] broke out the oscilloscope and hooked it up to the Elgato’s flash chip. It turns out that due to a bug in the program he was using, the SPI erase commands weren’t getting sent during the flash. This lead to corrupted firmware which was keeping the Elgato from booting. After making a pull request with his fixes, the firmware flashed without incident and the capture device now does double-duty as a webcam when necessary.

We could certainly think of easier and quicker was to roll your own webcam, but we’re glad that [Mike] took the time to modify his Elgato Cam Link 4K and document it. It’s a fantastic example of practical firmware hacking, even if you’re not in the market for a new high-definition video conferencing rig.

7 thoughts on “Capture Device Firmware Hack Unlocks All The Pixels

  1. Lockdown is creating a wave of webcam hacks as people look to improve their Jitsi/Zoom setup from the default potato quality.

    I recently picked the El Gato HD60S+ precisely because of this issue with the Cam Link and UVC drivers. I still had to decrypt the firmware on my Nikon DSLR to output clean HDMI on the latest firmware. Look forward to open hardware like the Orange Crab to transcode videos better than these janky “gaming solutions.”

    ps when did Hackaday start allowing capital letters in posts??

    1. I want a hack to brak the 29 minute video recording limit on a Nikin Coolpix S6200. Thanks to EU camcorder taxes, most any model of digital camera with video capability sold in the EU is limited to 30 minutes or less of video recording at a time – world wide – despite the lack of such silly taxes in other places.

      The Roxio Gamecap HD Pro is an exercise in greed and stupidity. If you have one but don’t have the software, Roxio will not let you obtain software for it. Can’t download it. Can’t buy it, unless you buy another complete Gamecap HD Pro kit with the device and software.

      I have one. I need software. I’d pay perhaps $25 for a replacement disc but like hell I’m going to pay $80 and have to get *another* piece of identical hardware just to get the software. I wonder if there’s some laws or regulations or something such a practice is violating – aside from it being a violation of common sense and decent business practice?

      1. > EU camcorder taxes

        That’s incorrect. If they can record more than 30 minutes, they are classified as video recorders that fall under copyright rules where you have to pay compensation the same as for blank CDs, DVDs, hard drives, etc. which are paid to the rights organizations and then dispensed to copyright holders after subtracting the organization costs. This is basically a two-way deal with US and EU copyrights lobby organizations to extort money out of people.

        It just so happens to fit well with the OEMs market segmentation strategies, because companies like Nikon and Panasonic are offering both video cameras AND point-and-shoot cameras, and the P&S offerings would be competing with the video cams. They intentionally cripple them in other markets as well. The lower end of the market is gone since cellphones took over the segment of cheap pocket cameras, so now they’re trying to sell up and sideways by removing features. People who need video features are pushed into buying video cams, people who need nice photography features are pushed into buying better digital cams, and people who need both are pushed into buying two products instead of one.

        For example, Sony removed the “super fine” compression option from their consumer cameras because it was good enough that most people saw no practical reason to shoot in raw mode. Now if you want nice pictures, you have to buy the more expensive camera that has both super fine and raw, while what used to be the middle market option has only standard and low, making it the new bottom of the market.

  2. Wouldn’t it make more sense to hack a shim or change the library so that a specific video format is requested from the device, rather than make the device only produce one format? This seems like a software problem and not a hardware problem.

  3. I wish I could videoconference with a 4K camera, but that’s not doable on most home Comcast connections, because they limit the upload speed to 5 Mbps. It is possible if I tether to my cell phone, but there is a bit more latency.

Leave a 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.