Visual Studio 2008 不对齐堆栈变量?
我正在尝试读取 OpenCV 2.1、VS2008 标准中的 avi 文件 2 天,但没有成功。我不断在程序控制台中收到此消息:
编译器未对齐堆栈变量。 Libavcodec 编译错误 并且可能会非常慢或崩溃。这不是 libavcodec 中的错误, 但在编译器中。您可以尝试使用 gcc >= 4.2 重新编译。 不要向 FFmpeg 开发人员报告崩溃。
..我得到的帧速率是 0.5fps 播放。我尝试了各种 AVI 和 MPEG 文件,但结果仍然相同。此外,所包含的使用网络摄像头的示例非常慢。我在使用 OpenCV 1.1 时没有遇到这样的问题
我已经尝试解决这个问题:
- 重新编译整个库
- 从 SVN 更新库并重新编译
- 尝试了各种版本的 libavcodec.a 文件
我用来读取的代码该文件看起来像这样:
CvCapture* input_video = cvCreateFileCapture("c:\\data\test.avi");
// ...
while (true) {
// ...
frame = cvQueryFrame( input_video );
cvShowImage("test", frame);
// ...
}
任何人都可以帮助我吗?这让我发疯:(
I'm trying to read an avi file in OpenCV 2.1, VS2008 standard for 2 days now with no luck. I constantly get this message in the program console:
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. You may try recompiling using gcc >= 4.2.
Do not report crashes to FFmpeg developers.
..and the framerate all I get is a 0.5fps playback. I tried with various AVI and MPEG files, still with the same results. Also, the included examples using the webcam are extremely slow. I did not have such problems when using OpenCV 1.1
Things I already tried to resolve this issue:
- Re-compiled the whole library
- Updated the library from SVN and re-compiled
- Tried various version of libavcodec.a file
The code I'm using to read the file is looks like this:
CvCapture* input_video = cvCreateFileCapture("c:\\data\test.avi");
// ...
while (true) {
// ...
frame = cvQueryFrame( input_video );
cvShowImage("test", frame);
// ...
}
Can anyone help me? This is driving me nuts :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,您还应该检查 cvCaptureFromAVI() 来替换 cvCreateFileCapture()。也许这是个好主意。
但我肯定会重新编译该库。尝试在配置中添加此选项:
--enable-force-stack-realign 或 --enable-memalign-hack
这些人似乎已经解决了这个问题:
http://ffmpeg.arrozcru.org/forum/viewtopic。 php?f=9&t=568
如果没有效果,为什么不尝试 Windows 的预编译二进制文件呢?
http://sourceforge.net/projects/opencvlibrary/files/opencv-win /2.1/
无论如何,您的问题是特定于软件的。我强烈建议您在适当的邮件列表和 OpenCV 相关论坛中寻找答案。
Well, you should also check cvCaptureFromAVI() to replace cvCreateFileCapture(). Maybe it's a good idea.
But I would most certainly recompile the library. Try adding this option in configure:
--enable-force-stack-realign or --enable-memalign-hack
These guys seem to have solved it:
http://ffmpeg.arrozcru.org/forum/viewtopic.php?f=9&t=568
If nothing works, why not try the pre-compiled binaries for Windows?
http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.1/
Anyway, your question is software specific. I strongly suggest you look for answers in appropriated mailing lists and OpenCV related forums.