c++qtopencvlogitech

OpenCv with the webcam c930e logitech


Here is the situation :

we have managed to get the camera to work with OpenCv 2.4.0 and Qt 5.0.2. The camera is supposed to be able to record 1080p videos at 30 fps.

However we are stuck at 10 fps when recording in 1920x1080.

Here is the code we are using :

Capture cv::VideoCapture;
Capture.open(0);
Capture.set(CV_CAP_PROP_FRAME_WIDTH, 1920):
Capture.set(CV_CAP_PROP_FRAME_HEIGHT, 1080);

We have already tried to use this command (that we got from Capturing 1080p at 30fps from logitech c920 with openCV 2.4.3):

Capture.set(CV_CAP_PROP_FOURCC, 'M', 'J', 'P', 'G');

but without any success.

We believe the camera's stream can be captured in h264 (thanks to the internal conversion the camera does) or in mjpg.

Like we said we are a bit confused/lost.

Any suggestion is welcomed ! Thanks


Solution

  • The solution for your problem is already mentioned in the other question you linked to: You have to set the codec before you set the wanted resolution:

    Capture cv::VideoCapture;
    Capture.open(0);
    Capture.set(CV_CAP_PROP_FOURCC, CV_FOURCC('M','J','P','G'))
    Capture.set(CV_CAP_PROP_FRAME_WIDTH, 1920):
    Capture.set(CV_CAP_PROP_FRAME_HEIGHT, 1080);