Skip to content

Change webcam resolution using v4l2 #221

Open
@rekumar

Description

@rekumar

I have mounted a USB endoscope to the gantry and am able to capture images using the following command:

ffmpeg -y -f video4linux2 -i /dev/video2 --ss 0:0:1 -frames 1 /data/user_storage/image.jpg

Despite being a 5 megapixel camera that registers properly on my other machines, the images I'm capturing with this command are at a 160x120 resolution. I believe I need to change the format using v4l2-ctl --set-fmt-video={width}x{height}, but it looks like v4l2 is not found in this version of Linux. Adding the -s 1024x768 command in ffmpeg as per the Opentrons docs stretches the image without changing the capture resolution.

Is there a way, v4l2 or otherwise, to change the format of the webcam stream within the opentrons version of linux?

PS -- I found a group from BNL that reported using v4l2 to control the format of a Logitech webcam mounted to their OT-2. Could this be a recent change to opentrons' buildroot? For context we just received our robot in early Jan 2024.

Thank you and let me know if any more info could help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions