Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

well.

1) i capture in minute and see "cout << cc << endl;" - 408. 408/60=6.8fps and cap.avi played with acceleration.

2) without writer.write(frame);, with imshow("MyVideo", frame); i have 480 frame per minute = 7.7fps without writer.write(frame); and imshow("MyVideo", frame); i have 8fps

Sistem idle in task manager - 98%

3)with VideoCapture cap(0 + CV_CAP_DSHOW); and cap.set(CV_CAP_PROP_FPS,25); without writer.write(frame); and imshow("MyVideo", frame); i have 8.1fps

I do not understand... :(

well. thank you.

1) i capture in minute and see "cout << cc << endl;" - 408. 408/60=6.8fps and cap.avi played with acceleration.

2) without writer.write(frame);, with imshow("MyVideo", frame); i have 480 frame per minute = 7.7fps without writer.write(frame); and imshow("MyVideo", frame); i have 8fps

Sistem idle in task manager - 98%

3)with VideoCapture cap(0 + CV_CAP_DSHOW); and cap.set(CV_CAP_PROP_FPS,25); without writer.write(frame); and imshow("MyVideo", frame); i have 8.1fps

I do not understand... :(

well. thank you.

1) i capture in minute and see "cout << cc << endl;" - 408. 408/60=6.8fps and cap.avi played with acceleration.

2) without writer.write(frame);, with imshow("MyVideo", frame); i have 480 frame per minute = 7.7fps without writer.write(frame); and imshow("MyVideo", frame); i have 8fps

Sistem idle in task manager - 98%

3)with VideoCapture cap(0 + CV_CAP_DSHOW); and cap.set(CV_CAP_PROP_FPS,25); without writer.write(frame); and imshow("MyVideo", frame); i have 8.1fps

I do not understand... :(

   VideoCapture cap(0 + CV_CAP_DSHOW); // open the video file for reading
    if ( !cap.isOpened() )  // if not success, exit program
    {
         cout << "Cannot open the video file" << endl;
         return -1;
    }

    cap.set(CV_CAP_PROP_FPS,25);
    double fps = cap.get(CV_CAP_PROP_FPS); //get the frames per seconds of the video
    cout << "Frame per seconds : " << fps << endl;
    namedWindow("MyVideo",CV_WINDOW_AUTOSIZE); //create a window called "MyVideo"
    int cc=0;
    while(1)
    {
        Mat frame;
        bool bSuccess = cap.read(frame); // read a new frame from video
         if (!bSuccess) //if not success, break loop
        {
                        cout << "Cannot read the frame from video file" << endl;
                       break;
        }
       cc++;
        if(waitKey(1) == 32) 
       {
                cout << "esc key is pressed by user" << endl; 
                cout << cc << endl; 
                waitKey(10000) ;
                 break; 
       }
    }