Camera frame capture issue with Python OpenCV on Linux

Hi, I’ve got an Arducam UB020201 UVC webcam on Linux and I’m seeing something strange. When I capture at 1280x720 or 800x600, only the top-left portion of the image shows up — the rest is cut off. At 1920x1080, 640x480, and 320x240 the full frame is there, it’s just smaller. My capture command is:
fswebcam -d /dev/video1 -r 1280x720 1280.jpg
I already tried a second camera of the same model and it does the exact same thing. Any ideas?

Thanks for the report. The fact that 1280x720 and 800x600 crop while 1920x1080/640x480/320x240 don’t is a useful clue. Could you try the same capture through VLC just to rule out fswebcam? If the crop shows up in VLC too, we know it’s not the capture tool.

I get the same cropping when I capture with Python and OpenCV, so I don’t think it’s fswebcam-specific. Do you have a Linux VLC command I can use to test the camera?

Sure. Could you also run these two v4l2-ctl captures? They write frames straight from the driver, which helps narrow things down (adjust the device node if yours is different):
v4l2-ctl --device /dev/video0 --stream-mmap --stream-count=1 --stream-to=dion.jpg --set-fmt-video=width=1280,height=720
v4l2-ctl --device /dev/video0 --stream-mmap --stream-count=1 --stream-to=dion.jpg --set-fmt-video=width=800,height=600
Please attach the resulting images.

Here you go. 1280x720 and 800x600 both still crop the same way. I also included a 1920x1080 shot where the full frame is visible, for comparison.
dion.jpg
dion2.jpg
dion3.jpg

We reproduced the same thing on our side. Based on that, this looks like an inherent characteristic of this model. The UB020201 was procured externally, so we don’t have the ability to optimize its firmware, and at the moment there’s no firmware fix we can offer for the crop.

That doesn’t quite add up on my end. I have two of these exact cameras from about a year ago, and neither one has this issue at 720p. Was the firmware changed since then? Also, does the same problem happen with the 5MP (UB023301) or the 16MP (B029001) camera?

That’s helpful context — if the older units are fine, it does point to a firmware difference. I’ve sent you a firmware update package via private message. Please check your messages, download the file, and follow the video to burn the new firmware. Replug the camera once the burn finishes.

I don’t see any link in your reply. Can you send it again?

Sorry about that. I’ve re-sent the firmware download link via private message. Please check and give the update a try.

Got it this time, thanks. I’ll flash it and report back.

Okay, I tried, but I can’t apply either .bin file to the webcam — the update tool throws an error. I’ve attached photos of the firmware version on the cameras that have the wrong 720p output.
IMG_2987.jpeg
IMG_2988.jpeg

Thanks for the photos. Let me send you the update packages for the other two models. I’ve PM’d you the files: one for the B029001 (download and follow the guide video to burn it) and one for the UB023301 (download, plug the camera in, and follow the steps in the screenshot).

The UB020201 firmware from earlier still can’t be applied to my device — I keep getting the same error. Is there another firmware version for the UB020201 I could try?

I’ve sent you another attachment via private message. Honestly, I’m not sure the UB020201 firmware needs updating — the last firmware update for that model is dated 24/8/2022. Right now I don’t have a confirmed fix for the 720p/600p cropping; that’s where this stands.