You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
Huh. We haven't really touched anything about the webcam stuff in quite a while, and I don't think we've ever had v4l2-ctl built and installed.
You could try using this python library: https://pypi.org/project/v4l2py . Since v4l2 is fundamentally a kernel driver API, you interact with it through ioctls, and python has a really good story for that, so this library should be installable on an OT-2 and doesn't actually contain any C code and in fact should be callable from a protocol.
This will be a little more annoying to use, but it looks like what you'd do (and unfortunately this is just from the docs for me - v4l2 devices are different enough that you'll have to see what your endoscope reports) is something like this, in a python shell (including a Jupyter notebook shell on the OT-2):
>>> from v4l2py.device import Device, BufferType
>>> cam = Device.from_id(2) # This should be the same number as /dev/videoN
>>> cam.open()
>>> print(cam.info.card) # this should probably print the model to confirm it's the right one
>>> cam.set_format(BufferType.VIDEO_CAPTURE, width=1024, height=768)
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 likev4l2
is not found in this version of Linux. Adding the-s 1024x768
command inffmpeg
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!
The text was updated successfully, but these errors were encountered: