I'm trying to process large AVI files (approx. 61000 frames, 505MB) with
OpenCV, using cvCaptureFromAVI()
and cvQueryFrame()
.
However, cvQueryFrame()
returns a NULL
pointer before it reaches the last frame
of the avi.
long int numframe = 6000;
while (numframe < 67000)
{
frame = cvQueryFrame( capture );
if (! frame)
{
fprintf(stderr, "could not query the frame %ld.\n", numframe);
break;
}
char namefile[250];
sprintf( namefile, "/media/6E86F8CB03A4DFA4/image-sequence/%ld.jpg", numframe );
cvSaveImage( namefile, frame ); // save frame as a image
numframe++;
}
Has anyone else has had the same problem and found a way aro开发者_Go百科und it? Is there something that I can do?
Most probably you are experienced one of the FFMPEG integration bugs. This bugreport looks very similar to your problem.
What version of OpenCV are you using?
Any way I recommend you:
Try another version of OpenCV
Try to build OpenCV without FFMPEG. Probably OpenCV will be able to read your file with VfW or GStreamer.
精彩评论