Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Need to read video in MJPEG format using VideoCapture

I need to read video in MJPG format. I tried the following - cap2.set(CV_FOURCC('M', 'J', 'P', 'G') ) It threw an error.

How do I achieve this?

Need to read video in MJPEG format using VideoCapture

I need to read video in MJPG format. I tried the following -

cap2.set(CV_FOURCC('M',
import cv2
cap1 = cv2.VideoCapture(0)
cap1.set(CV_CAP_PROP_FOURCC, ('M', 'J', 'P', 'G') )
'G'))

It threw an error.is throwing this error - NameError: name 'CV_CAP_PROP_FOURCC' is not defined

After which I tried -

cap1.set(6, ('M', 'J', 'P', 'G'))

Now, the error is - TypeError: a float is required

How do I achieve this?capture a video in MJPEG format from the webcam?