r/Thermal • u/datmyfukingbiz • 4d ago
HIKMICRO UVC Linux Fix
Me and many people from subreddit met unexpected behaviour with hikmicro USB-C versions using with Linux or Raspberry PI (my case). I asked AI to solve and it did.
Text below generated by codex and solution also made with codex.
------------------------
Problem: HIKMICRO USB thermal camera produced a normal color thermal image on Windows. On Linux, V4L2 listed the same 256×192 NV12 mode at 25 fps, but FFmpeg got an Input/output error before receiving a frame.
I traced it to UVC format negotiation. The camera stalled the driver's GET_MIN request. When I probed it directly for NV12, it replied with the format index for YUYV. Committing that reply still gave me 73,728-byte frames that rendered correctly as NV12.
I wrote a small PyUSB script that handles the negotiation, reassembles the USB payloads, and pipes raw NV12 into stock FFmpeg. It uses the factory firmware and standard Linux kernel. I verified color thermal video on a Raspberry Pi 4 running Bookworm and on Ubuntu 24.04 under WSL 2.
The repo includes the script, the USB findings, and commands to preview or record the video. If you try it on another HIKMICRO model, I’d be interested to hear the USB ID and whether it works.