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 开发者_StackOverflow中文版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 :(
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.
精彩评论