使用opencv调用摄像头获取视频时报出如下错误
[ WARN:0] OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
[ WARN:0] OpenCV | GStreamer warning: GStreamer: unhandled property
[ WARN:0] OpenCV | GStreamer warning: Embedded video playback halted;module v4l2src0 reported:Internal data flow error.
[ WARN:0] OpenCV | GStreamer warning: unable to start pipeline
大部分时调用时对摄像头的参数设置有错误
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*'MJPG'))
cap.set(cv2.CAP_PROP_FPS, 30) //我设置帧率为60,就会报错
版权声明:本文为u011573853原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。