How to explicitly access mjpeg backend for videocapture in opencv
问题 When I execute following: availableBackends = [cv2.videoio_registry.getBackendName(b) for b in v2.videoio_registry.getBackends()] print(availableBackends) I get ['FFMPEG', 'GSTREAMER', 'INTEL_MFX', 'V4L2', 'CV_IMAGES', 'CV_MJPEG'] . If I now try: 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) all work except the last one AttributeError: module 'cv2.cv2' has no attribute 'CAP_MJPEG' . How can I explicitely