Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从相机读取多个帧后,OpenCV突然总是无法读取帧。如何诊断?_Opencv - Fatal编程技术网

从相机读取多个帧后,OpenCV突然总是无法读取帧。如何诊断?

从相机读取多个帧后,OpenCV突然总是无法读取帧。如何诊断?,opencv,Opencv,我运行了一个类似于此问题的程序: 注意:前两行并不总是存在 那么,我如何确定问题的根源呢 #include <opencv/highgui.h> #include <iostream> /** @function main */ int main( int argc, char** argv ) { cv::VideoCapture vcap; cv::Mat image; const std::string videoStreamAddre

我运行了一个类似于此问题的程序:

注意:前两行并不总是存在

那么,我如何确定问题的根源呢

#include <opencv/highgui.h>

#include <iostream>

/** @function main */
int main( int argc, char** argv )
{
    cv::VideoCapture vcap;
    cv::Mat image;

    const std::string videoStreamAddress = "rtsp://192.0.0.1:8081/live.sdp";

    //open the video stream and make sure it's opened
    if(!vcap.open(videoStreamAddress)) {
        std::cout << "Error opening video stream or file" << std::endl;
        return -1;
    }

    for(;;) {
        if(!vcap.read(image)) {
            std::cout << "No frame" << std::endl;
            cv::waitKey(500);
        } else {
            cv::imshow("Output Window", image);
        }
        if(cv::waitKey(1) >= 0) break;
    }
}
[mpeg4 @ 00da27a0] ac-tex damaged at 22 7
[mpeg4 @ 00da27a0] Error at MB: 309
No frame
No frame
No frame