video files not opening--in opencv with c++
Dec 5, 2009 at 5:46pm UTC
Hello !!
i am a newbie to opencv and working with it in windows. i have opencv 1.0. installed . Any code for video doesn't work in my computer.It is possibly not reading the video file. Here's a sample code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "highgui.h"
#include<stdio.h>
int main( int argc, char ** argv ) {
cvNamedWindow( "Example2" , CV_WINDOW_AUTOSIZE );
CvCapture* capture = cvCreateFileCapture( argv[1] );
IplImage* frame;
while (1) {
frame = cvQueryFrame( capture );
if ( !frame )
break ;
cvShowImage( "Example2" , frame );
char c = cvWaitKey(33);
if ( c == 27 )
break ;
}
cvReleaseCapture( &capture );
cvDestroyWindow( "Example2" );
}
do we have to seperately install some other program like ffmpeg ??
please help..thank u !!
Last edited on Dec 5, 2009 at 5:47pm UTC
Topic archived. No new replies allowed.