Mình đang cần xử lí với 1 đoạn AVI nhưng làm theo hướng dẫn mà vẫn không chạy được file AVI do ko bắt được lỗi ngoại lệ và memory leak. Ai từng làm qua mong chỉ hộ mình. Đây là code
Code:
// camera.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include "stdio.h"
using namespace std;
int main()
{
CvCapture* capture = cvCaptureFromAVI("F:\\PHIM\\one_piece\\001.avi");
int fps =(int) cvGetCaptureProperty(capture,5);
cvNamedWindow("test",1);
if(fps!=0)
{
while(1)
{
IplImage* frame = cvQueryFrame(capture);
if(!frame) break;
cvShowImage("test",frame);
char c = cvWaitKey(1000/fps);
if(c=='q')break;
cvReleaseImage(&frame);
}
}
cvReleaseCapture(&capture);
cvDestroyWindow("test");
}
. I have finish Take photo with OpenCV.
. Nếu không load được file AVI có thể Load file bất kì.
) hoặc có thể tải KLite_codec để có codec chạy file AVI. ^^!

Comment