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

[HOW-TO] Know USB camera resolution #526

Closed
RobertFlatt opened this issue Jan 17, 2023 · 4 comments
Closed

[HOW-TO] Know USB camera resolution #526

RobertFlatt opened this issue Jan 17, 2023 · 4 comments

Comments

@RobertFlatt
Copy link

RobertFlatt commented Jan 17, 2023

Please only ask one question per issue!
I want to get the best possible usb resolution, for still image capture. How do I know what I can specify?

Describe what it is that you want to accomplish
By default usb camera resolution appears to be 640x480 for both YUYV and MJPEG
This seems good for a 4:3 preview.
I want higher resolution for a still capture, I expect the resolution to depend on the usb camera used.

Describe alternatives you've considered
I tried setting a plausible, and higher resolution:
If in a still_configuration I set main = {'size' : (1440, 1080)}
I get a capture that is 1600 x 896 , so it seems there is more resolution to be had.
But this is not the size I asked for, and is not 4:3 it is 16:9
Configuring higher resolutions, showed similar behavior.

Additional context
Add any other context or screenshots about the request here.

@RolandasRazma
Copy link

@RobertFlatt
Copy link
Author

For a usb cameras I tried picam2.sensor_modes only contains 'format' , tried two Logitech (very common) usb cameras, for each all that is returned by sensor_modes is two formats:

{'format': 'MJPEG'}
{'format': 'YUYV'}

Experiment shows that picamera2 generates a stream from a usb camera that can have discrete values of "size".
How to enumerate these discrete values?
Is it possible to query libcamera directly?

@RolandasRazma
Copy link

what about
v4l2-ctl --list-formats-ext -d /dev/video0 ?

@davidplowman
Copy link
Collaborator

Hi, I'm afraid USB camera support is limited with Picamera2, and we have no plans to extend it at the moment. You could try whether picam2.sensor_resolution will give you the maximum output resolution . You can of course use the regular V4L2 style interface, such as v4l2-ctl, too.

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

3 participants