Ask Your Question
0

VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV

asked 2019-05-07 12:23:01 -0600

projectdrone2 gravatar image

On rpi using Opencv4.0 with a USB Logitech 480p camera, executing cap = cv2.VideoCapture(index) hangs the system. Removing the USB camera unfreeze the system and gives the following error:

VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV

VIDEOIO ERROR: V4L: can't open camera by index 0

VIDIOC_REQBUFS: No such device

Anybody has a way to fix this issue?

Thanks in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-05-09 16:02:20 -0600

projectdrone2 gravatar image

updated 2019-05-10 06:20:42 -0600

I found a workaround which is to open and immediately close a cam then reopen it!

so instead of

cam = cv2.VideoCapture(0)

do

cam = cv2.VideoCapture(0)
cam.release()
cam = cv2.VideoCapture(0)

Hope it works for you as well!

Edit May 10th:

I've noted that actually you need to run the Open/Close/Open sequence once with the USB Cam NOT plugged to your rpi. Then you plug it back and run Open/Close/Open then the script you want

edit flag offensive delete link more

Comments

That's **ed up. Can you please put the model number of your camera in the original question?

sjhalayka gravatar imagesjhalayka ( 2019-05-09 19:34:10 -0600 )edit

Hello sjhalayka, it is an old Logitech C270. Hope this help.

projectdrone2 gravatar imageprojectdrone2 ( 2019-05-10 06:22:06 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-05-07 12:23:01 -0600

Seen: 5,997 times

Last updated: May 10 '19