Writing AVI files in OpenCV

前端 未结 7 839
青春惊慌失措
青春惊慌失措 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:08

    I think the problem you're encountering is that your "for" loop never ends; therefore, cvReleaseVideoWriter(&writer); and cvReleaseCapture(&input); never get called. Try something like for(int i=0; i<200; i++) and see if you end up with a working video.

    Often video is written to a temporary files before being finalized on disk. If your file isn't finalized, there won't be anything to see.

    Hope that helps.

提交回复
热议问题