Ask Your Question

Revision history [back]

Unable to capture .avi video frames (Visual studio 2010)

I am a beginner. Following code running well in VS-2010 but the video frames are not displayed in window. when I am displaying image it was ok.

#include "opencv\highgui.h"

    using namespace cv;

     int main( int argc, char** argv )
     {
     cvNamedWindow("bus", CV_WINDOW_AUTOSIZE);
     CvCapture* capture=cvCreateFileCapture("bus_cif.avi");
     IplImage* frame;
     while (1)
     {
     frame= cvQueryFrame ( capture );
     if (!frame) break;
     cvShowImage ("bus", frame);
     char c=cvWaitKey(33);
     if (c ==27) break;
     }

     cvReleaseCapture(&capture);
     cvDestroyWindow("bus");
 }