Ask Your Question

Revision history [back]

Have you tried this:

capture = cv2.VideoCapture(self.cam_id, cv2.CAP_V4L2)
capture.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'))

And also building from source with -D WITH_V4L=ON and -D WITH_LIBV4L=ON.