OpenCV错误(cvCreateFileCapture())

OpenCV错误(cvCreateFileCapture()),c,video,opencv,avi,C,Video,Opencv,Avi,我正在使用C语言中的OpenCV。我打算在一个窗口上运行一个视频(在使用我制作的算法显示帧之前,先对帧进行一点图像处理)。但是,以下行: CvCapture* capture = cvCreateFileCapture("eve.avi"); 给我一个错误: OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat,

我正在使用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。

尝试安装ffmpeg库:

sudo apt-get install libavformat-dev libswscale-dev
如果它仍然坏了,试着使用一个已知有效的示例视频(我会同时尝试找到一个,并在我找到的时候编辑这篇文章)

编辑:试试这个


都做完了。获取ffmpeg之前已经完成,所以我得到:
codelibavformat dev已经是最新版本了。libswscaledev已经是最新版本了。0已升级,0已新安装,0已删除,297未升级。
我还使用了sample.avi,因为我怀疑没有任何更改。