Cannot change video capture codec to MJPEG

asked 2015-03-11 22:05:42 -0600

BPCook gravatar image

Max OS. OpenCV 2.4.9. UVC camera capable of both YUY2 and MJPEG.

All we want to do is change the codec of a live webcam video from YUY2 to MJPEG. OpenCV always defaults to YUY2, but this results in a very slow frame rate.

cap.set(6, cv2.cv.CV_FOURCC('M','J','P','G'))

will not work. That only works when recording video. We need to process video in real time.

Thank you.

edit retag flag offensive close merge delete

Comments

What capture backend does you camera use? It is possible that OpenCV does not cover the set property for your backend. Can't you use the tool of the camera itself to set it to MJPEG?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-03-12 04:52:51 -0600 )edit