当我执行以下命令时:
availableBackends = [cv2.videoio_registry.getBackendName(b) for b in v2.videoio_registry.getBackends()]
print(availableBackends)
我得到['FFMPEG', 'GSTREAMER', 'INTEL_MFX', 'V4L2', 'CV_IMAGES', 'CV_MJPEG']
如果我现在尝试:
print(cv2.CAP_FFMPEG)
print(cv2.CAP_GSTREAMER)
print(cv2.CAP_INTEL_MFX)
print(cv2.CAP_V4L2)
print(cv2.CAP_IMAGES)
print(cv2.CAP_MJPEG)
除最后一项外的所有工作AttributeError: module 'cv2.cv2' has no attribute 'CAP_MJPEG'
如何明确设置cv2.CAP_CV_MJPEG后端(cv2.CAP_CV_MJPEG也不起作用)
您可以看到所有的标志here
看起来
cv2.CAP_OPENCV_MJPEG
就是你要找的以下测试创建MJPEG合成AVI视频文件,并使用
cv2.CAP_OPENCV_MJPEG
后端读取视频:相关问题 更多 >
编程相关推荐