Regarding OpenCV 1.1 cvCapturefromAVI method

Hi…I am having some problems with using cvCapturefromAVI method using opencv1.1

Images work fine and webcam capture also works however capturing from file isn’t

I have installed ffmpeg as well.

The program is the simplest capture program from the o’reilly book example.

The problem is that capture always returns NULL.


int main( )

IplImage *frame=cvLoadImage(“0.jpg”);
int key;

/* supply the AVI file to play */
//assert( argc == 2 );

/* load the AVI file */
CvCapture *capture = cvCreateFileCapture (“out.avi”);


return 0;



the program always returns fail .no matter what I do …

I also tried to use the mencoder out.avi -nosound -ovc raw -vf format=i420 -o out.avi since I thought codec would be a problem…

however I am still getting the fail message.

I have read a lot about this and lot of ppl seem to have the problem.If anyone has a workaround please help.



is this an openframeworks question? if not, then here might not be the best place to ask it.

it appears you are asking about opencv only. can you please try the opencv mailing list:

not trying to be rude, just trying to point you in the right direction – you’ll get better results asking in the right place.

take care,

Dear Zach,

Thanks for ur suggestion.I ask qns on this forum since the users used to reply patiently to all my qns appropriately.

No worries Ill make sure to ask all my qns on the OpenCV forum.



please don’t be offended:

I ask qns on this forum since the users used to reply patiently to all my qns appropriately.

we will continue to reply patiently to your questions, but if you ask straight opencv questions, then you are going to get referred to the opencv mailing list, which is the appropriate place to ask those questions. you asked something else before about cvPoint, and it seems to me that the reason you got no answers is that you are asking in the wrong place. The opencv mailing list is quite active, and you will find many people doing straight opencv, and also, the author of the book you are mentioning.

It’s not to say you are not welcome, you are very much welcome here. it’s just that this is an openframeworks forum, and we’d like to keep the conversation focused.

thanks &
take care,