Skip to content
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

Add mjpeg support to camera #102458

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

underdoeg
Copy link
Contributor

@underdoeg underdoeg commented Feb 5, 2025

I was receiving jpeg decoding errors when trying to use mjpeg with a microsoft lifecam studio webcam on linux. The same code worked fine with a logitech c920 camera though. And the camera works with any other application.
After some investigation, I stumbled upon this blog post https://lightbits.github.io/v4l2_huffman/ that explains that a mjpeg frame does not necessarily has to include the a huffman table which seems to trip up the jpgd library.
This code checks if a table is defined and injects a default one if it is not.

@underdoeg underdoeg requested a review from a team as a code owner February 5, 2025 14:09
@AThousandShips AThousandShips changed the title add mjpeg support to camera Add mjpeg support to camera Feb 5, 2025
@AThousandShips AThousandShips added this to the 4.x milestone Feb 5, 2025
@underdoeg
Copy link
Contributor Author

underdoeg commented Feb 5, 2025

This is maybe more of a temporary fix. A better solution might be a jpeg decoder that is able to handle mjpeg frame data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants