Ilkin Mammadov
Ilkin Mammadov

Reputation: 23

OpenCv VideoCapture Error in Linux - Setting property #0 is not supported

I want to open webcam in c++ using Opencv in Linux OS.

int main()
{
    VideoCapture video(0);

    // ..
}

But there is small problem:

VIDEOIO ERROR: V4L2: setting property #0 is not supported

I am only sure that webcam works. Because cheese works.

Thanks.

Upvotes: 0

Views: 1972

Answers (1)

Khalil Khalaf
Khalil Khalaf

Reputation: 9407

The parameter in this context is the camera index and the index 0 in Windows is either the first available camera or the one which is not plugged via USB (not exactly sure).

In Linux on the other hand, you just remove the parameter since it works by default on any available camera.

VideoCapture video(); should work. And you can find more information in the Documentation.

Upvotes: 1

Related Questions