Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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”

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” );

}

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 ) break;

{

printf("EMPTY OR NULL");

break;//ends HERE!!!!!

} cvShowImage( “Example2”, frame );

char c = cvWaitKey(33);

if( c == 27 ) break;

}

cvReleaseCapture( &capture );

cvDestroyWindow( “Example2” );

}

click to hide/show revision 3
No.3 Revision

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 “highgui.h”
 #include "stdio.h"
 

include "stdio.h"

int main( int argc, char** argv ) {

{

cvNamedWindow( “Example2”, CV_WINDOW_AUTOSIZE );

);

CvCapture* capture = cvCreateFileCapture( argv[1] );

); IplImage* frame;

IplImage* frame;

while(1) {

while(1) {

frame = cvQueryFrame( capture );

);

if( !frame ) {

{

printf("EMPTY OR NULL");

NULL"); break;//ends HERE!!!!!

break;//ends HERE!!!!!

} cvShowImage( “Example2”, frame );

);

char c = cvWaitKey(33);

cvWaitKey(33);

if( c == 27 ) break;

break; }

}

cvReleaseCapture( &capture );

);

cvDestroyWindow( “Example2” );

);

}

}
click to hide/show revision 4
improved style

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”
“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” );

}