Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python USB网络摄像头不再适用于opencv:VIDIOC_QBUF:无效参数_Python_Opencv_Webcam_Raspberry Pi4_Debian Buster - Fatal编程技术网

Python USB网络摄像头不再适用于opencv:VIDIOC_QBUF:无效参数

Python USB网络摄像头不再适用于opencv:VIDIOC_QBUF:无效参数,python,opencv,webcam,raspberry-pi4,debian-buster,Python,Opencv,Webcam,Raspberry Pi4,Debian Buster,我只是尝试通过以下方式访问Raspberry Pi上带有opencv的USB网络摄像头: import cv2, time cap = cv2.VideoCapture(0) time.sleep(3) while True: time.sleep(0.1) ret, frame = cap.read() if ret: cv2.imshow('frame', frame) if cv2.waitKey(1) & 0xFF == or

我只是尝试通过以下方式访问Raspberry Pi上带有opencv的USB网络摄像头:

import cv2, time

cap = cv2.VideoCapture(0)
time.sleep(3)

while True:
    time.sleep(0.1)
    ret, frame = cap.read()

    if ret:
        cv2.imshow('frame', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()
它只会生成一个永不结束的错误消息流:VIDIOC_QBUF:Invalid Argument

当我插入Logitech网络摄像头C260或Logitech网络摄像头C910时,摄像头指示灯亮起,/dev/video0文件被创建。还尝试了两种不同的RPi 4

我的个人形象建设: Raspberry Pi 4、Raspbian Buster v10、Python 3.7.3、OpenCV 4.1.0

PyImageSearch提供的图像生成: 树莓皮4, Raspbian Buster v10, Python 3.7.3, OpenCV 4.1.1

其他人也遇到过这个问题,但我还没有找到任何解决办法


任何帮助都将不胜感激。

我也遇到了同样的问题,通过安装uv4l uvc解决了这个问题

sudo apt install uv4l uv4l-uvc

感谢您的反馈,但uv4l还没有更新Buster,所以它不会以这种方式安装。我试着按照这个安装工作,但现在我的USB摄像头甚至不能被识别。谢谢,这意味着其他安装已经为我解决了这个问题。在安装picamera[array]之后,我一直在使用Python的摄像头,可能就是这样。将尝试另一个R pi并更新我的答案。