简体   繁体   English

OpenCV 2.3 中的 VideoCapture 问题

[英]Problem with VideoCapture in OpenCV 2.3

I have problem in using VideoCapture calss for opening a MPEG video file.我在使用VideoCapture类打开 MPEG 视频文件时遇到问题。 The code was compile properly.代码已正确编译。 However, during the running time, it can not open the file and give me the following warning message:但是,在运行期间,它无法打开文件并给我以下警告消息:

warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:477)警告:打开文件时出错 (../../modules/highgui/src/cap_ffmpeg_impl.hpp:477)

I have this problem only when I build my code in debug mode.只有当我在调试模式下构建我的代码时,我才会遇到这个问题。 I relsease mode the code works correctly.我发布模式代码正常工作。

The code also works correctly in the c style using CvCapture and cvCaptureFromAVI (in both release and debug mode), however, I'd like to develop my code in more C++ style.该代码在c样式中也可以正常工作,使用CvCapturecvCaptureFromAVI (在发布和调试模式下),但是,我想以更多 C++ 样式开发我的代码。

(I am using OpenCV 2.3 in Visual-studio (C++) 10) (我在 Visual-studio (C++) 10 中使用 OpenCV 2.3)

Thank you for you helps谢谢你的帮助

Check your include paths.检查您的包含路径。 It sounds like the build environment is properly configured for Release-mode but not Debug-mode.听起来构建环境已正确配置为发布模式而不是调试模式。

I think it is a problem with opencv 2.4.2 In my case I changed it to opencv 2.4.3.我认为这是 opencv 2.4.2 的问题在我的情况下,我将其更改为 opencv 2.4.3。 Now it is working.现在它正在工作。 But some works like face detection are not working with opencv 2.4.3.但是一些像人脸检测这样的工作不适用于 opencv 2.4.3。 Build a new project and include the directories of opencv 2.4.3.构建一个新项目并包含 opencv 2.4.3 的目录。 It will work then.届时它将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM