Using device name instead of ID in OpenCV method VideoCapture.open()

后端 未结 3 817
感动是毒
感动是毒 2021-01-06 08:31

I have a lot of video devices in my /dev folder (e.g. video1, video2, ..., video9) and one /dev/video which

3条回答
  •  不思量自难忘°
    2021-01-06 09:14

    By looking at the source code of OpenCV 2.4.11 (cap.cpp) you can see that the overload using const string& filename is calling 'cvCreateFileCapture' which uses other plugins as FFMPEG or GStreamer to load files so the answer is no.

    bool VideoCapture::open(const string& filename)
    {
       if (isOpened()) release();
       cap = cvCreateFileCapture(filename.c_str());
       return isOpened();
    }
    

提交回复
热议问题