第一次使用打开的简历无法播放avi文件 [英] first time using open cv not able to play avi file

查看:86
本文介绍了第一次使用打开的简历无法播放avi文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

int main()
    {
    cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
    CvCapture* capture = cvCaptureFromAVI( "a.avi" );
    IplImage* frame;

    if(!capture)
    {
        printf("fail");
    }
    else
    {

    while(1) 
    {
    frame = cvQueryFrame( capture );
    cvShowImage( "Example2", frame );
    char c = cvWaitKey(40);
    if( c == 27 ) break;
    }
    cvReleaseCapture( &capture );
    cvDestroyWindow( "Example2" );
    }
    return 0;
    }

我在打开的简历中尝试播放的视频的帧速率为29帧/秒,帧宽为720,高度为480,视频格式为DX50,带有avi包装器

the frame rate of the video i tried with open cv is 29 frames/s and frame width is 720 and height is 480 the format of the video is DX50 with avi wrapper

显示名为example2的空白窗口,该窗口消失了...

the blank window is showed named example2 which goes away...

问题是cvcapturefromavi确实返回了指针,这就是为什么不打印失败的原因

the problem is cvcapturefromavi does return the pointer thats why fail is not printed

操作系统窗口7

推荐答案

如果将opencv构建为静态库,则会发现bin目录中仍然存在dll文件"opencv_ffmpegxxxxx.dll".即使您将代码与opencv静态链接,也需要此dll.因此,请确保系统可以找到此dll文件.

If you build opencv to static library, you will find there is still a dll file "opencv_ffmpegxxxxx.dll" in the bin directory. This dll is required even if you link your code with opencv statically. So make sure the system can find this dll file.

这篇关于第一次使用打开的简历无法播放avi文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆