views:

176

answers:

1

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 :(

+1  A: 

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.

karlphillip
The precompiled binaries are normally built with mingw, I see this problem when linking ming/vs built codecs.
Martin Beckett
Binaries compiled with MingW are as good as any other. What happened when you recompiled the sources using the flags I mentioned above? Let us know.
karlphillip
Thanks for the answers. I dedided to use the 1.1 version instead of 2.0, because it works for me and has the features I need and I don't want to put any more time in this problem. Cheers
janek