【问题标题】:OpenCV error (cvCreateFileCapture())OpenCV 错误 (cvCreateFileCapture())
【发布时间】:2013-02-24 15:09:27
【问题描述】:

我正在使用 C 语言使用 OpenCV。我打算在窗口上运行视频(并在使用我制作的算法显示它们之前对帧进行一点图像处理)。但是以下行:

    CvCapture* capture = cvCreateFileCapture("eve.avi");        

给我错误:

OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported
array type) in cvGetMat, file /build/buildd/opencv-2.3.1/modules/core/src/array.cpp, 
line 2482 terminate called after throwing an instance of 'cv::Exception'
what():  /build/buildd/opencv-2.3.1/modules/core/src/array.cpp:2482: error: (-206) 
Unrecognized or unsupported array type in function cvGetMat

我尝试了各种我发现的 .avi 文件,并且都产生了这个。使用 Ubuntu 12.10。

【问题讨论】:

    标签: c video opencv avi


    【解决方案1】:

    尝试安装 ffmpeg 库:

    sudo apt-get install libavformat-dev libswscale-dev
    

    如果它仍然损坏,请尝试使用已知有效的示例视频,(我会尝试在此期间找到一个并在我这样做时编辑这篇文章)。

    编辑:试试这个。

    http://www.technical-recipes.com/2011/displaying-avi-video-using-opencv/

    【讨论】:

    • 全部搞定。获取 ffmpeg 之前已经完成,所以我得到:codelibavformat-dev is already the newest version. libswscale-dev is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 297 not upgraded. 我也使用了 sample.avi,因为我怀疑没有任何改变。
    猜你喜欢
    • 1970-01-01
    • 2010-12-31
    • 1970-01-01
    • 2012-07-14
    • 2012-12-27
    • 2011-10-11
    • 2012-03-16
    • 2018-08-06
    • 2013-05-03
    相关资源
    最近更新 更多