【发布时间】:2012-09-08 03:15:36
【问题描述】:
我已使用以下方法将视频保存到文件中:
NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
documentsDirectory = [documentsDirectory stringByAppendingPathComponent:@"test9.avi"];
NSLog(@"Open to: %@", documentsDirectory);
std::string fileName([documentsDirectory cString], [documentsDirectory cStringLength]);
videoWriter = new cv::VideoWriter(fileName, CV_FOURCC('H', 'F', 'Y', 'U'), 25, cvSize(288,352),1);
但我无法使用 VideoCapture 打开它:
NSLog(@"Load the video");
videoCapture = new cv::VideoCapture();
NSLog(@"Video loaded");
if (videoCapture->open(fileName))
{
NSLog(@"Opened");
}
else {
NSLog(@"Failed to open");
}
VideoCapture 本身没有错误,只是我的日志“无法打开”... 我能以某种方式获得更详细的错误日志吗?
【问题讨论】:
-
您要处理视频中的单个帧还是整个文件?
-
我想处理整个文件。我是记录文件的人,因此我可以将其记录为任何格式。现在我正在实现一个简单的转储 cv::Mat 到二进制文件的方法并以同样的方式读回它......这样我就不必使用 VideoCapture。
标签: ios opencv video-capture