Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

After a lot of tests with ffmpeg and try to understand how i get the access to the webcam features in opencv. I found out that my cam is a "dshow" device which is provided from Windows Standard Webcam Driver.

So to get deeper access to the device I have to start the capture with this flag.

capture.set(Videoio.Cap_DSHOW + 0); // instead of capture.set(0);

The FourCC flag is also necessary.

    int fourcc = VideoWriter.fourcc('M', 'J', 'P', 'G');
    capture.set(Videoio.CAP_PROP_FOURCC, fourcc);

After this changes i can capture with 58 fps and have almost no latency!

Hope this helps someone!

After a lot of tests with ffmpeg and try to understand how i get the access to the webcam features in opencv. I found out that my cam is a "dshow" device which is provided from Windows Standard Webcam Driver.

So to get deeper access to the device I have to start the capture with this flag.

capture.set(Videoio.Cap_DSHOW + 0); // instead of capture.set(0);

The FourCC flag is also necessary.

    int fourcc = VideoWriter.fourcc('M', 'J', 'P', 'G');
    capture.set(Videoio.CAP_PROP_FOURCC, fourcc);

Now this line has an effect..

capture.set(Videoio.CAP_PROP_FPS,60);

After this changes i can capture with 58 fps and have almost no latency!

Hope this helps someone!

After a lot of tests with ffmpeg and try to understand how i can get the access to the webcam features in opencv. I found out that my cam is a so called "dshow" device which is provided from Windows Standard Webcam Driver.

So to get deeper access to the device I have to start the capture with this flag.

capture.set(Videoio.Cap_DSHOW + 0); // instead of capture.set(0);

The FourCC flag is also necessary.

    int fourcc = VideoWriter.fourcc('M', 'J', 'P', 'G');
    capture.set(Videoio.CAP_PROP_FOURCC, fourcc);

Now this line has an effect..

capture.set(Videoio.CAP_PROP_FPS,60);

After this changes i can capture with 58 fps and have almost no latency!

Hope this helps someone!