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

Getting "Corrupt JPEG data: 1 extraneous bytes before marker 0xd4" at runtime, but library still works. Can I get pre-encoded jpeg streams? #21

Open
djohn49 opened this issue Feb 28, 2021 · 1 comment

Comments

@djohn49
Copy link

djohn49 commented Feb 28, 2021

My use case for this library is to get a stream of jpeg images, and I was expecting to have to encode them myself (or, rather, integrate with another library to do it). But, I noticed that, although the example still displays exactly as it should, messages of the form "Corrupt JPEG data: 1 extraneous bytes before marker 0xd4" (the marker's hex and number of extraneous bytes varies) spam the terminal when I run the mirror example, suggesting that libuvc is decoding jpeg images internally. Obviously, it's less than idea to have the library decode jpeg images only for them to be immediately re-encoded back into jpeg. As such, is there some way to access these images as jpeg?

@mulimoen
Copy link
Collaborator

Occasionally magnled output is normal (see e.g. libuvc/libuvc#122), and depends on the camera. You could file an issue towards libuvc if you would like to examine this in further detail.

The decoding of jpeg frames are done in the frame_to_raw_image crate in the mirror example. You can change the callback to use the raw bytes directly if you'd like, simply call to_bytes on the Frame in the callback. This should not involve any decoding by libuvc.

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

No branches or pull requests

2 participants