1 | initial version |
There are several problems with your code:
You code would look something like this:
#include <highgui.h>
#include <stdio.h>
int main( int argc, char** argv )
{
cvNamedWindow("Example2", CV_WINDOW_AUTOSIZE);
CvCapture *capture = cvCreateFileCapture(argv[1]);
if (!capture)
{
printf("!!! Failed cvCreateFileCapture\n");
return -1;
}
IplImage* frame = NULL;
while(1)
{
frame = cvQueryFrame(capture);
if (!frame) break;
cvShowImage("Example2" , frame);
cvWaitKey(33);
}
cvReleaseCapture(&capture);
cvDestroyWindow("Example2");
return 0;
}