`VideoCapture` from file fails in `ff_yuyvToY_sse2` function.

asked 2013-06-06 10:59:37 -0500

Michał Rus gravatar image

updated 2013-06-06 11:48:50 -0500

I get a SIGSEGV when trying to get a frame from an .avi file:

#include <opencv2/opencv.hpp>

using namespace cv;

int main(int argc, char *argv[])
{
    VideoCapture capture("V:/DATA/640.AVI");
    if (!capture.isOpened())
        return -1;
    Mat tmp;
    capture >> tmp;
    return 0;
}

capture >> tmp; is the failing line. Debugger says that the instruction marked below in function ff_yuyvToY_sse2 is causing the problem:

        Function: ff_yuyvToY_sse2
0x715f756a  <+0x001a>         sldt   (%eax)
0x715f756d  <+0x001d>         add    %cl,0xf66731c(%ebp)
0x715f7573  <+0x0023>         je     0x715f7547 <ff_nv21ToUV_mmx+87>
0x715f7575  <+0x0025>         psrlw  $0x8,%xmm2
0x715f757a  <+0x002a>         jne    0x715f75a2 <ff_yuyvToY_sse2+82>
0x715f757c  <+0x002c>         neg    %esi

;
; the instruction below fails:
;
0x715f757e  <+0x002e>         movdqa (%ebx,%esi,2),%xmm0

0x715f7583  <+0x0033>         movdqa 0x10(%ebx,%esi,2),%xmm1
0x715f7589  <+0x0039>         pand   %xmm2,%xmm0
0x715f758d  <+0x003d>         pand   %xmm2,%xmm1
0x715f7591  <+0x0041>         packuswb %xmm1,%xmm0
0x715f7595  <+0x0045>         movdqa %xmm0,(%eax,%esi,1)
0x715f759a  <+0x004a>         add    $0x10,%esi
0x715f759d  <+0x004d>         jl     0x715f757e <ff_yuyvToY_sse2+46>
0x715f759f  <+0x004f>         pop    %esi
0x715f75a0  <+0x0050>         pop    %ebx
0x715f75a1  <+0x0051>         ret
0x715f75a2  <+0x0052>         neg    %esi
0x715f75a4  <+0x0054>         movdqu (%ebx,%esi,2),%xmm0
0x715f75a9  <+0x0059>         movdqu 0x10(%ebx,%esi,2),%xmm1
0x715f75af  <+0x005f>         pand   %xmm2,%xmm0
0x715f75b3  <+0x0063>         pand   %xmm2,%xmm1
0x715f75b7  <+0x0067>         packuswb %xmm1,%xmm0
0x715f75bb  <+0x006b>         movdqa %xmm0,(%eax,%esi,1)
0x715f75c0  <+0x0070>         add    $0x10,%esi
0x715f75c3  <+0x0073>         jl     0x715f75a4 <ff_yuyvToY_sse2+84>
0x715f75c5  <+0x0075>         pop    %esi
0x715f75c6  <+0x0076>         pop    %ebx
0x715f75c7  <+0x0077>         ret
0x715f75c8  <+0x0078>         nop
0x715f75c9  <+0x0079>         lea    0x0(%esi,%eiz,1),%esi

0x715f757e  <+0x002e>         movdqa (%ebx,%esi,2),%xmm0

OpenCV version is 2.4.9 compiled from source (cloned yesterday).

Edit: works as expected when I remove opencv_ffmpeg.dll from PATH... It would be nice, however, to be able to use FFMPEG...

edit retag flag offensive close merge delete