4

この質問のようなプログラムを実行します: https://stackoverflow.com/a/8719192/26070

#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;
    }
}

プログラムは一定時間 (約 1 分程度) 正常に実行され、その後 read() (cv::VideoCapture のメソッド) の呼び出しは常に を返しますfalse

出力は次のとおりです。

[mpeg4 @ 00da27a0] ac-tex damaged at 22 7
[mpeg4 @ 00da27a0] Error at MB: 309
No frame
No frame
No frame

注: 最初の 2 行は常に存在するとは限りません。

では、問題の根本原因を特定するにはどうすればよいでしょうか。

4

0 に答える 0