Ask Your Question

Deepak's profile - activity

2019-10-31 09:23:02 -0600 received badge  Famous Question (source)
2016-02-03 05:05:01 -0600 received badge  Notable Question (source)
2015-01-26 05:44:56 -0600 received badge  Popular Question (source)
2013-08-16 02:32:21 -0600 received badge  Editor (source)
2013-08-16 02:29:50 -0600 asked a question problem playing avi video, cvcreateFileCapture returning NULL pointer

Hi there! I used the following code, which compiled successfully and used lots of avi files to test a.out with.

But every time, NULL pointer was returned. Please help, same problem is stated here :http://nuigroup.com/forums/viewthread/6132/, but solutions there havent helped me yet.

Code:

#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 ) 
{ 
printf("EMPTY OR NULL");
break;//ends HERE!!!!!
}
cvShowImage( “Example2”, frame );  
char c = cvWaitKey(33);
if( c == 27 ) break;
}

cvReleaseCapture( &capture );
cvDestroyWindow( “Example2” );

}