在openCV中打开文件(/home/vaibhav/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:553)时出错 [英] Error opening file (/home/vaibhav/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:553) in openCV
问题描述
我正在使用OpenCV来显示视频 我的代码是
I am using OpenCV to display a video my code is as
#include<opencv2/highgui.hpp>
#include<cv.h>
#include<opencv/cv.hpp>
#include<opencv2/opencv.hpp>
#include<cvaux.h>
#include<cxcore.h>
#include<stdio.h>
#include<highgui.h>
#include<stdlib.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
int main( int argc, char ** argv )
{
CvCapture* capture;
cvNamedWindow( "video", CV_WINDOW_AUTOSIZE );
capture = cvCreateFileCapture("/home/vaibhav/program/c/w.avi");
IplImage* frame;
while(1){
frame = cvQueryFrame( capture );
if( !frame ) break;
cvShowImage( "video", frame );
char c = cvWaitKey(33);
if( c == 27 ) break;
}
cvReleaseCapture( &capture );
cvDestroyWindow( "Webcam" );
return 0; }
程序可以编译,但是尝试运行时会出错
The program compiles but it gives error when try to run it
我正在使用Ubuntu 12.04和Eclipse
I am using Ubuntu 12.04 and Eclipse
warning: Error opening file (/home/vaibhav/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:553)
推荐答案
在这里消除一些混乱:
该错误表示它无法找到或打开您的视频文件. (找不到文件或编解码器不存在)
the error means, that it could not find or open your Video file. (either file not found, or codec not present)
"/home/vaibhav/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:553"只是代码的位置,引发了错误.
"/home/vaibhav/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:553" is just the location of the code, where the error is thrown.
(而且,请不要再使用不推荐使用的c-api,他们像5年前一样停止开发它,改用c ++了.)
(and please, don't use the deprecated c-api any longer, they stopped developing it like 5 years ago, switch over to the c++ one. )
这篇关于在openCV中打开文件(/home/vaibhav/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:553)时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!