Use mjpeg compression
Hi all,
I would like to use the mjpeg compression of my webcam (logitech c920). I can see with $v4l2-ctl --list-formats that MJPEG is supported:
Output:
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Index : 1
Type : Video Capture
Pixel Format: '' (compressed)
Name : 34363248-0000-0010-8000-00aa003
Index : 2
Type : Video Capture
Pixel Format: 'MJPG' (compressed)
Name : MJPEG
But I tried different ways to set the compression in my code but it doesn't work.
I tried:
cap.set(CV_CAP_PROP_FOURCC, 'M', 'J', 'P', 'G');
which leeds to the outputs that there are to many parameters. Therefore I changed to second parameter like this.
cap.set(CV_CAP_PROP_FOURCC, 2);
This leads to following output:
HIGHGUI ERROR: V4L: Property <unknown property string>(6) not supported by device
HIGHGUI ERROR: V4L2: Unable to get property <unknown property string>(6) - Invalid argument
Would be great to get your help. I appreciate any suggestions.
I'm having the same problem, did you find a solution?