Very low frame rate capture from USB Camera on Linux

asked 2019-05-06 07:18:02 -0600

Hi there ,

I am mid-level programmer and I do have an issue with the capture process when i build my libraries. when When the OpenCV installed through repositories (apt-get install) the camera capture frame-rate it the same as the the hardware of the camera supports. I can adjust the resolution and change the capture format (eg. YUV and mjpg) and I do have the expected results . And as expected from the camera manuals , when I choose YUV format the frame rate is about one third if I have choose MJPEG format .

When I built my libraries and use them I can use them without any problem and errors . My only problem is the capture frame rate from my USB camera which is low. I have set-up the on my source code MJPEG format and it seems that it uses YUV . Below you can find the piece of code where i define the format and the resolution.

VideoCapture cap;
cap.open(1);
cap.set(CV_CAP_PROP_FOURCC, CV_FOURCC('M', 'J', 'P', 'G'));
cap.set(CV_CAP_PROP_FRAME_WIDTH, 1920);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 1080);

The same code has been used in both cases mentioned before . Further more I have tested that with python and the same results. In any case there is no errors or warnings

I think is worth to mention that in any cases other applications like Skype and cheese are not affected at all in both cases.

I have Ubuntu 18.04 and I am working with Opencv 3.4.6 with the contribute projects.

Is there any dependency missing from my built ? Is there any case that there is any conflict with the libraries ?

Please , If anybody can suggest me anything please comment bellow

Thanks Jericho

edit retag flag offensive close merge delete