我下载了解码器之后,opencv中还是不能播放出视频来
代码如下:#include"cv.h"#include"highgui.h"intmain(intargc,char**argv){cvNamedWindow("vide...
代码如下:
#include "cv.h"
#include "highgui.h"
int main(int argc,char** argv)
{
cvNamedWindow("video",CV_WINDOW_AUTOSIZE);
CvCapture* capture = cvCreateFileCapture("video.avi");
IplImage* frame;
frame = cvQueryFrame(capture);
if (!frame)
{
break;
}
cvShowImage("video",frame);
char c = cvWaitKey(33); //当前帧显示后,等待33秒
if( c == 27)
break;
cvReleaseCapture(&capture);
cvDestroyAllWindows();
return 0;
} 展开
#include "cv.h"
#include "highgui.h"
int main(int argc,char** argv)
{
cvNamedWindow("video",CV_WINDOW_AUTOSIZE);
CvCapture* capture = cvCreateFileCapture("video.avi");
IplImage* frame;
frame = cvQueryFrame(capture);
if (!frame)
{
break;
}
cvShowImage("video",frame);
char c = cvWaitKey(33); //当前帧显示后,等待33秒
if( c == 27)
break;
cvReleaseCapture(&capture);
cvDestroyAllWindows();
return 0;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询