Windows OpenCV VideoCapture不会打开视频文件 [英] Windows OpenCV VideoCapture Will Not Open Video File

查看:682
本文介绍了Windows OpenCV VideoCapture不会打开视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我和我的团队正在开发一个OpenCV(v.2.4.2)和QT(v.4.8.4)的项目。我们正在开发QtCreator。这是一个跨平台的项目,主要是寻找视频文件的移动。

在Mac OSX上,视频文件将使用正常的cv :: VideoCapture对象和界面正常打开,我们可以成功运行我们的程序。但是,在Windows上,文件不会打开,只是在程序退出时在QtCreator终端上抛出这个错误:

 警告:打开文件时出错(../../modules/highgui/src/cap_ffmpeg_impl.hpp:361)

然而,当我们将QtCreator设置为'Release'构建模式而不是'Debug'时,程序将打开文件。



我的队友和我做了大量的研究这个错误,并没有找到真正的解决方案。
我们已经尝试安装编码解码器,将opencv_ffmpeg.dll文件移动到.exe的工作目录,并使用opencv_ffmpeg.dll的位置(以及ffmpeg库的位置)修改路径。也确保了我们的视频是有效的,以及文件路径(相同的视频在MacOS上工作,而视频文件实际上将通过Qt的Phonon模块在Windows中播放)。



类似的问题:

视频捕获OpenCV 2.4.2错误在Windows中



在OpenCV 2.3中的VideoCapture的问题



任何想法可能会导致此问题解决方案不幸的是,我不能给出原因,但如果我们使用预编译的OpenCV dl,我们也经常会遇到这些问题L的。通过将ffmpeg连接到视频捕捉来引起错误。在我们的案例中,在有关计算机上重建OpenCV修复了这个错误。


My team and I are working on a project with OpenCV (v. 2.4.2) and QT(v. 4.8.4). We are developing in QtCreator. It is a cross-platform project that will be primarily looking for movement in video files.

On the Mac OSX, the video file will open properly using the normal cv::VideoCapture object and interface and we can run our program successfully. However, on Windows, the file would not open, just throwing this error on the QtCreator terminal when the program exits:

warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:361)

However, when we set QtCreator to 'Release' build mode instead of 'Debug', the program opens the file as it should.

My teammate and I have done extensive research on this error and found no real solutions. We have tried installing codecs, moving the opencv_ffmpeg.dll file to the working directory of the .exe, and modifying the path with the location of the opencv_ffmpeg.dll (as well as the location of the ffmpeg library.) We have also made sure that our video is valid, as well as the file path (the same video works on a MacOS, and the video file will actually play in Windows through Qt's Phonon module).

Similar questions:

VideoCapture OpenCV 2.4.2 error in windows

Problem with VideoCapture in OpenCV 2.3

Any ideas about what could be causing this issue?

解决方案

Unfortunately, I can't give the reason but we also often get these problems if we use precompiled OpenCV dll's. The error is caused anywhere by connecting ffmpeg to the videocapture. In our case rebuilding OpenCV on the concerned computer fixed the error.

这篇关于Windows OpenCV VideoCapture不会打开视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆