mirror of
https://github.com/gen2brain/cam2ip.git
synced 2026-04-26 22:55:53 +03:00
[GH-ISSUE #20] jpeg: read: camera: invalid JPEG format: uninitialized Huffman table #18
Labels
No labels
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cam2ip#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Fmstrat on GitHub (Oct 5, 2019).
Original GitHub issue: https://github.com/gen2brain/cam2ip/issues/20
Using a Logitech webcam I'm getting:
I'm guessing this is a similar problem to this fix:
https://github.com/blackjack/webcam/issues/7#issuecomment-231543221
@gen2brain commented on GitHub (Oct 5, 2019):
It looks like it is valid for MJPEG frames to omit the Huffman table and expect some default to be used. Browsers do that, they will load such an image even if not valid, probably by adding some default table.
I am guessing you are on Linux and don't use provided binaries but you compiled with native image/jpeg support and with native V4L, right? It will probably work with OpenCV build, with libjpegturbo it will probably be a different error.
Problem is, it is not correct to just add tables as in your link, will need to detect first if that is the issue, my cam, for example, returns valid JPEG with Huffman tables from MJPEG. One way is to match if the error string contains
HuffmanI guess, but that is ugly. Something like this would be great https://github.com/golang/go/issues/10447 but it is not implemented.@Fmstrat commented on GitHub (Oct 5, 2019):
Ubuntu 18.04, using the latest Docker HUB release. Camera works as expected in
cheeseand withmotion. Hope that helps!@gen2brain commented on GitHub (Oct 5, 2019):
Yes, docker image is built without CGO, and uses native image/jpeg and native V4L.
Can you try with binaries from releases, and paste error messages, this one https://github.com/gen2brain/cam2ip/releases/download/1.5/cam2ip-1.5-64bit.tar.gz uses libjpegturbo and V4L, and this one https://github.com/gen2brain/cam2ip/releases/download/1.5/cam2ip-1.5-64bit-cv2.tar.gz libjpegturbo and OpenCV.
@carlos-sarmiento commented on GitHub (Dec 13, 2019):
Is there any reason not to include the solution to this issue in the docker image release?
@gen2brain commented on GitHub (Dec 16, 2019):
@carlos-sarmiento the solution should not be included unconditionally, it should probably check error string for Huffman table, a little ugly, but if nothing else possible I agree. I don't have the webcam that behaves like that or time to work on this now. PRs are welcome.
@davralin commented on GitHub (Dec 30, 2020):
I have a RPI3 with a Logitech C310, and docker-image gave me
uninitialized Huffman table.I used cam2ip-1.6-RPi3.tar.gz and console is spammed with the following during a stream:
I can't really help any more than that, but errormessages aside, the camera does stream.
@davralin commented on GitHub (Jan 14, 2021):
Same issue on amd64 with a Logitech C510.
Doesn't work with Docker, works just fine with the relevant release - I created davralin/cam2ip witch contains the amd64-build for now, as I have to use this in a container (deployed on k8s).
@gen2brain commented on GitHub (Jan 14, 2021):
@davralin so you use OpenCV or native build?
@davralin commented on GitHub (Jan 15, 2021):
Native build I'd guess?
Source is here: https://github.com/davralin/cam2ip-docker/blob/main/run.sh
@T0MuX commented on GitHub (Mar 6, 2021):
Hi, same issue with https://github.com/gen2brain/cam2ip/releases/download/1.6/cam2ip-1.6-RPi.tar.gz
When I access to http://localhost:56000/html, I got this :
2021/03/06 22:48:20 socket: read: camera: invalid JPEG format: uninitialized Huffman tableWhen I access to http://localhost:56000/jpeg, I got this :
2021/03/06 22:50:23 jpeg: read: camera: invalid JPEG format: uninitialized Huffman tableAnd when I access to http://localhost:56000/mjpeg, I got this big one :
@T0MuX commented on GitHub (Mar 6, 2021):
Okay, the "edit button" of Github doesn't work for me so I post again...
I forgot to specify : I'm using ArchlinuxARM on a Raspberry 1B. Also, I miswrote : I was using cam2ip-1.6-RPi-nocgo.tar.gz
But since, I "solved" this switching to cam2ip-1.6-RPi.tar.gz :)
@5vr commented on GitHub (Feb 16, 2024):
https://github.com/golang/go/issues/10447#issuecomment-1506257410
How to use it now?
@gen2brain commented on GitHub (Feb 16, 2024):
To use what, something that is not implemented? I guess you would have to implement it first. Look for alternative approach above and send PR if you can.
@gen2brain commented on GitHub (Jun 15, 2025):
I added support for
jpegli, which uses an option that disables Huffman tables and uses arithmetic coding instead. To build it, add-tags jpeglito the build command. This should probably fix the issue, although it will work a little slower, but it is still acceptable.