-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frames are "invalid JPEG format: uninitialized Huffman table" #7
Comments
Unfortunately I cannot reproduce the issue on my hardware which complicates things a bit. Can you provide details on your platform? Does any other software properly work with your camera? |
When redirecting the mjpeg stream to the browser, it reproduces normally. The webcam is Logitech Orbit AF, running on ARM (Raspbian on a Raspberry Pi 3). The code is currently in filiptc/gorbit (https://github.com/filiptc/gorbit/blob/master/image/overlay.go). |
Here's the saved binary: frame |
Oddly enough, browsers seem not to care about Huffman tables... If you download the file and try to open it in a desktop app it will throw the Huffman table error. |
So I've been making myself smart and it seems that mjpeg stream frames do not have Huffman Table information (DHT). This was taken out and standardized for bandwidth optimization. The standardized DHT segment (where the starting
The browsers seem to parse the jpeg type header (AVI1) and do the DHT loading internally. |
Here's the function that adds DHT and creates a standard JPEG file: https://github.com/filiptc/gorbit/blob/fa87ff39b68a6706306f34c318e0b9a5a3c97110/image/overlay.go#L37-L40 |
I'm glad that you've managed to figure out and solve the problem. |
Damn! My microsoft HD 3000 camera has the same "optimization", your code fixed it! Thanks |
Hi, I'm reading the frames in Motion-JPEG format, to add an overlay. But doing the following...
...yields error
invalid JPEG format: uninitialized Huffman table
.Thanks in advance,
Phil
The text was updated successfully, but these errors were encountered: