Question: I have a lot of video devices in my `/dev` folder (e.g. `video1`, `video2`, ..., `video9`) and one `/dev/video` which is always pointing to the valid device (which, of course, can change).
I want to open the `/dev/video` device with OpenCV using `cv::Videocapture` and realized that there are only two ways to open it:

```
VideoCapture::VideoCapture(const string& filename)
VideoCapture::VideoCapture(int device)

```

The first one opens a file and the second one opens `/dev/video[device]`.

Is there any way to do something like `cap = cv::VideoCapture("/dev/video");`?

Answer: 
with current OpenCV 3.2.0 you can create a new capture like this:

```
cv::VideoCapture cap("/dev/video20", cv::CAP_V4L);

```

its one of the additional constructors:

> 
> [VideoCapture (const String &filename, int apiPreference)](http://docs.opencv.org/3.2.0/d8/dfe/classcv_1_1VideoCapture.html#a85b55cf6a4a50451367ba96b65218ba1)  
> 
>  Open video file or a capturing device or a IP video stream for video capturing with API Preference.
> 
> 
> 

this is also possible with the open function:

```
cap.open("/dev/video20", cv::CAP_V4L);

```

i have tested this successfully under Kubuntu 16.10 with self compiled openCV from current git master.
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();
}

```