OpenCV 2.4.7与FFMpeg支持构建与VS 2010(x86) [英] OpenCV 2.4.7 with FFMpeg support build with VS 2010 (x86)
问题描述
我在使用新版本的OpenCV 2.4.7几乎一个星期(上一个使用2.4.2)。我的新设置的动机是,我遇到问题使用Videowriter的未压缩的灰度视频( http://answers.opencv.org/question/3603/videowriter-videocapture-and-uncompressed-avi/ )。在 https://github.com/Itseez/opencv/pull/1516 akarsakov建议在没有vfw支持的情况下构建OpenCV,并通过ffmpeg打开未压缩的视频。这就是我试图做的。我基本上遵循了此视频中提及的说明: http:// docs .opencv.org / trunk / doc / tutorials / introduction / windows_install / windows_install.html
我使用Qt 5.1.1成功构建了opencv href =http://answers.opencv.org/question/24184/how-to-compile-opencv-247-with-qt-and-ffmpeg/ =nofollow> http://answers.opencv。 org / question / 24184 / how-to-compile-opencv-247-with-qt-and-ffmpeg / )。但我不能得到VideoWriter& VideoCapture为我工作。所以我做了:
-
我生成了vs2010项目禁用VfW并启用ffmpeg:
视频I / O:
Windows视频: b $ b DC1394 1.x:NO
DC1394 2.x:NO
FFMPEG:YES(预编译的二进制)
编解码器:YES(ver 55.18.102)
format:YES (ver 55.12.100)
util:YES(ver 52.38.100)
swscale:YES(ver 2.3.100)
gentoo-style:YES
OpenNI:NO
OpenNI PrimeSensor模块:NO
PvAPI:NO
GigEVisionSDK:NO
DirectShow:YES
媒体基金会:NO
XIMEA:NO
-
我将ffmpeg的include目录和lib添加到highgui模块。
我无法编译OpenCV而没有任何错误,但我看到的行为不是我的期望:
- 在没有VfW的情况下构建OpenCV 2.4.7 - > VideoWriter.open()总是返回false!
- 使用VfW - > VideoWriter构建OpenCV 2.4.7。
- 使用或不使用ffmpeg - > VideoCapture.open()返回true的时间,在同一对象上调用release()和open )给出一个错误消息,要求libiconv-2dll!
有一些问题相同,能够指出我的错误吗?
提前谢谢。
cheers
OpenCV 2.4.7需要更新版本的FFmpeg才能正常工作,
问题的原因可能是 错误 #2281 : VideoCapture :: read在未压缩视频中失败。
作为中介解决方案,我建议您降级到OpenCV 2.4.5
I'm fighting with new version of OpenCV 2.4.7 for almost one week (prev. used 2.4.2). My motivation for the new setup is the fact that I run into problems using the Videowriter for uncompressed grayscale videos (http://answers.opencv.org/question/3603/videowriter-videocapture-and-uncompressed-avi/). In https://github.com/Itseez/opencv/pull/1516 "akarsakov" is recommending to build OpenCV without vfw support and open uncompressed video through ffmpeg. That's what I tried to do. I followed basically the instructions mentioned in this video: http://docs.opencv.org/trunk/doc/tutorials/introduction/windows_install/windows_install.html
I had successfully build opencv with Qt 5.1.1 (http://answers.opencv.org/question/24184/how-to-compile-opencv-247-with-qt-and-ffmpeg/). But I'm not able to get the VideoWriter & VideoCapture work for me. So what I did:
I downloaded the newest ffmpeg build from http://ffmpeg.zeranoe.com/builds/
I generated the vs2010 project disabling VfW and enabling ffmpeg instead:
Video I/O: Video for Windows: NO DC1394 1.x: NO DC1394 2.x: NO FFMPEG: YES (prebuilt binaries) codec: YES (ver 55.18.102) format: YES (ver 55.12.100) util: YES (ver 52.38.100) swscale: YES (ver 2.3.100) gentoo-style: YES OpenNI: NO OpenNI PrimeSensor Modules: NO PvAPI: NO GigEVisionSDK: NO DirectShow: YES Media Foundation: NO XIMEA: NO
I added the include directories and libs for ffmpeg to the highgui module.
I was not able to compile OpenCV without any errors but the behaviour what I see is not what I expect:
- Build OpenCV 2.4.7 without VfW -> VideoWriter.open () returns always false!
- Build OpenCV 2.4.7 with VfW -> VideoWriter.open () returns true for the time, calling a release() and an open() on the same object returns always a false.
- With or without ffmpeg -> An VideoCapture.open () gives a error message asking for libiconv-2dll!
Does some had the same problems and is able to point me to my mistake?
Thank you in advance. cheers
OpenCV 2.4.7 requires a more recent version of FFmpeg to work, but that doesn't seem to the issue since you have that covered.
The cause of your problem could be bug #2281: VideoCapture::read fails on uncompressed video.
As an intermediary solution, I suggest you to downgrade to OpenCV 2.4.5.
这篇关于OpenCV 2.4.7与FFMpeg支持构建与VS 2010(x86)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!