【发布时间】:2013-05-21 01:48:28
【问题描述】:
我想用 OpenCV 打开视频文件dt_passat.mpg。我使用以下代码:
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int main( int argc, char** argv )
{
VideoCapture capture("dt_passat.mpg");
if (!capture.isOpened()) {
std::cerr << "ERR: capture is not opened" << std::endl;
getchar();
return -1;
}
}
但是,它失败了,我不知道为什么。如何了解 VideoCapture 初始化的问题所在(未找到文件/损坏的文件/未知的编解码器/等)?
【问题讨论】:
标签: c++ opencv error-handling