2

I am using a common logitech webcam with OpenCV. When I was using my RPI3 I had no trouble, but I wanted to improve my system so I bought a RPI4.

Upon setting up my system with RPI4 using raspian buster I've started getting:

VIDIOC_DQBUF: Resource temporarily unavailable 

After I saw this question here I tried:

pi@raspberrypi:~ $ sudo rmmod uvcvideo pi@raspberrypi:~ $ sudo modprobe uvcvideo nodrop=1 timeout=5000 quirks=0x80 

Now my image comes like this:

Half green image

The upper part of the image is ok, it's night time and it is pointing to my backyard, however I don't know how to solve the green part problem.

Any ideas?

2
  • Your webcam device is in this list in Supported device : Device works state for 046d:0825 Logitech HD Webcam C270, can you put your dmesg or syslog output ? Commented Jan 9, 2020 at 11:41
  • How did you install opencv? Commented Jan 9, 2020 at 11:53

1 Answer 1

0

I've managed to do it!!!

This is really needed:

pi@raspberrypi:~ $ sudo rmmod uvcvideo pi@raspberrypi:~ $ sudo modprobe uvcvideo nodrop=1 timeout=5000 quirks=0x80 

But also, I had to set my webcam FPS prop to a low value.

0. CV_CAP_PROP_POS_MSEC Current position of the video file in milliseconds. 1. CV_CAP_PROP_POS_FRAMES 0-based index of the frame to be decoded/captured next. 2. CV_CAP_PROP_POS_AVI_RATIO Relative position of the video file 3. CV_CAP_PROP_FRAME_WIDTH Width of the frames in the video stream. 4. CV_CAP_PROP_FRAME_HEIGHT Height of the frames in the video stream. 5. CV_CAP_PROP_FPS Frame rate. 6. CV_CAP_PROP_FOURCC 4-character code of codec. 7. CV_CAP_PROP_FRAME_COUNT Number of frames in the video file. 8. CV_CAP_PROP_FORMAT Format of the Mat objects returned by retrieve() . 9. CV_CAP_PROP_MODE Backend-specific value indicating the current capture mode. 10. CV_CAP_PROP_BRIGHTNESS Brightness of the image (only for cameras). 11. CV_CAP_PROP_CONTRAST Contrast of the image (only for cameras). 12. CV_CAP_PROP_SATURATION Saturation of the image (only for cameras). 13. CV_CAP_PROP_HUE Hue of the image (only for cameras). 14. CV_CAP_PROP_GAIN Gain of the image (only for cameras). 15. CV_CAP_PROP_EXPOSURE Exposure (only for cameras). 16. CV_CAP_PROP_CONVERT_RGB Boolean flags indicating whether images should be converted to RGB. 17. CV_CAP_PROP_WHITE_BALANCE Currently unsupported 18. CV_CAP_PROP_RECTIFICATION Rectification 

Before starting to read the cam just do:

cam.set(cv2.CAP_PROP_FPS, 10) 

All set! :)

5
  • 3
    Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year. Commented Feb 9, 2020 at 14:51
  • There's no checkmark to accept the answer, don't know what to do :( Commented Feb 11, 2020 at 12:40
  • Sorry, haven't seen that you have just made the answer. Please wait 48 hours, then it should be possible to accept an own answer. Commented Feb 11, 2020 at 13:03
  • It´s been a month already... Commented Feb 13, 2020 at 12:23
  • Seems you are using two accounts with the same name. Please use the same account you have made the question, the account with 21 reputation. Only the owner of a question can accept answers, of course. Commented Feb 13, 2020 at 17:59

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.