From 203f95d3be6a490cc24ffe2933b3723d3ea718e9 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 3 Jul 2018 15:44:53 +0300 Subject: [PATCH] samples: videocapture_camera use VideoCapture with 0 index Not all backends support -1 index. --- samples/cpp/videocapture_camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cpp/videocapture_camera.cpp b/samples/cpp/videocapture_camera.cpp index 4d5a341657..ca39b2093b 100644 --- a/samples/cpp/videocapture_camera.cpp +++ b/samples/cpp/videocapture_camera.cpp @@ -11,7 +11,7 @@ int main(int, char**) { Mat frame; cout << "Opening camera..." << endl; - VideoCapture capture(-1); // open the first available camera + VideoCapture capture(0); // open the first camera if (!capture.isOpened()) { cerr << "ERROR: Can't initialize camera capture" << endl;