Hi all, I’m stuck with an Arducam IMX477 on a Raspberry Pi 4, connected through the standard CSI ribbon. It works perfectly with libcamera/rpicam from the terminal — pictures and video look great. But I can’t open it from Python at all. Any OpenCV script I try ends up throwing a ‘select() timeout’ error. Has anyone seen this?
That error usually means OpenCV is trying to open a UVC/USB video device and timing out. A camera on the CSI port isn’t exposed to OpenCV the way a USB webcam is, so that would explain why libcamera/rpicam work but OpenCV doesn’t. Can you post the exact code you’re using to open the camera and the full error text?
Sure, this is basically what I’ve been trying: cap = cv2.VideoCapture(0) if not cap.isOpened(): print(‘camera not opened’) It prints ‘camera not opened’ after a long delay, and depending on the backend I get the select() timeout. I also tried indexes 0 through 3 with the same result. I read that OpenCV needs the camera on USB. I’m looking at the Arducam CSI to USB UVC Camera Adapter Board for Raspberry Pi HQ Camera (B0278) to make it appear as a UVC device. Would that fix it?
Yes, that’s the root cause. OpenCV’s VideoCapture expects a USB/UVC device by default, and the IMX477 connected over CSI can’t be opened directly that way. The B0278 UVC adapter would make the camera show up as a UVC device, so OpenCV could access it. But you don’t strictly need the adapter — you can keep the CSI connection and use picamera2 to feed frames into OpenCV. I’ll post both paths.
I also saw some comments online saying the B0278 adapter needs a firmware update to work correctly on a Raspberry Pi 4. Is that firmware available publicly, or do I have to contact Arducam individually to get it?
For the B0278 firmware, check the Arducam UVC docs and the B0278 product page first. If you need a specific firmware package, I can send the current files through private message — I just can’t post a direct download link here. Firmware aside, for the CSI-only route, have a look at this picamera2 example: picamera2_examples/CaptureOpencvExample.py at main · ArduCAM/picamera2_examples · GitHub It grabs frames from the IMX477 MIPI camera and passes them into OpenCV, so you avoid cv2.VideoCapture entirely.
Thanks. So with that example I’m not opening the camera with cv2.VideoCapture at all — I’m just processing frames picamera2 provides? I’ll try that.
Correct. picamera2 handles the camera through the CSI/libcamera stack, and OpenCV only processes the frames. Don’t use cv2.VideoCapture(0) on that path. If you go with the B0278 UVC adapter instead, the camera becomes a UVC/USB device, and you’d follow this OpenCV Python GStreamer guide: Access UVC Cameras using OpenCV, Python, and GStreamer on Linux - Arducam Wiki Use the GStreamer pipeline string rather than a plain camera index.
Got it. So for the B0278 route, I’d use cv2.VideoCapture with a GStreamer pipeline string, not just 0?
Exactly. For the B0278 route, use the GStreamer pipeline from that guide in cv2.VideoCapture. To summarize: the select() timeout happens because a CSI-connected IMX477 can’t be opened directly by OpenCV. Either use the picamera2 example (CaptureOpencvExample.py) while it’s on CSI, or use the B0278 UVC adapter and the OpenCV/GStreamer guide for UVC access. Let us know which route you take and if the error changes.