Writing AVI files in OpenCV

前端 未结 7 779
青春惊慌失措
青春惊慌失措 2021-01-11 14:38

There example on the net and code given in Learn OpenCv,Orielly.

After many attempts the out.avi file is written with 0 bytes. I wonder where i went wrong.

T

7条回答
  •  借酒劲吻你
    2021-01-11 15:12

    Maybe you could try inserting a printf("Frame found\n") inside the for(;;) to see if it is actually capturing frames. Or even better:

    if(colourImage == NULL) {
        printf("Warning - got NULL colourImage\n");
        continue;
    }
    cvNamedWindow( "test", 1);
    cvShowImage( "test", colourImage );
    cvWaitKey( 0 );
    cvDestroyWindow( "test" );
    

    Then see if you get any windows, and if they contain the right contents.

提交回复
热议问题