Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

try to reduce it to:

VideoCapture cam(camNum); if (cam.isOpened() { Mat frame; if (! cam.read(frame)) break; imshow("W",frame); if (waitKey(10)>0) break; }

in other words, get rid of all that SDL debris first.

try to reduce it to:

 VideoCapture cam(camNum);
  if (cam.isOpened() {
Mat frame;
if (! cam.read(frame)) break;
imshow("W",frame);
if (waitKey(10)>0) break;
}

}

in other words, get rid of all that SDL debris first.

try to reduce it to:

    VideoCapture cam(camNum);
    if while (cam.isOpened() {
         Mat frame;
         if (! cam.read(frame)) break;
         imshow("W",frame);
        if (waitKey(10)>0) break;
   }

in other words, get rid of all that SDL debris first.

try to reduce it to:

    VideoCapture cam(camNum);
    while (cam.isOpened() {
         Mat frame;
         if (! cam.read(frame)) break;
         imshow("W",frame);
        if (waitKey(10)>0) break;
   }

in other words, get rid of all that SDL debris first.

try to reduce it to:

    VideoCapture cam(camNum);
    while (cam.isOpened() {
        Mat frame;
        if (! cam.read(frame)) break;
        imshow("W",frame);
        if (waitKey(10)>0) break;
    }

in other words, get rid of all that SDL debris first.

try to reduce it to:

    VideoCapture cam(camNum);
    while (cam.isOpened() {
        Mat frame;
        if (! cam.read(frame)) break;
        imshow("W",frame);
        int k = waitKey(10); // NO YOU DON'T NEED SDL !
        if (waitKey(10)>0) break;
(k == 27) break; // escape pressed
    }

in other words, get rid of all that SDL debris first.

then try to avoid gstreamer, and use v4l instead:

   VideoCapture cam(0, CAP_V4L);