OpenCV 3.0问题 - 录制视频内存泄漏

时间:2015-10-18 07:23:54

标签: c++ ios opencv ios8 opencv3.0

对不起,对于一个老问题,但我没有找到任何帮助。我正在使用OpenCV 3.0框架开发iOS应用程序。

我正在使用cvVideoCamera delgate来录制视频但是当我设置_cvVideoCam.recordVideo = YES;时,它总是给我内存警告错误。 如果我设置cvVideoCam,recordVideo = YES;,那么没有任何内存警告,但输出网址在记录结束时始终显示(null)。

提前致谢。

1 个答案:

答案 0 :(得分:0)

    please check your

    -(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer.....

     for - 
                                                     withPresentationTime:lastSampleTime] ) 
    {
                         NSLog(@"Video Writing Error");
                     }
                    if (pixelBuffer != nullptr)
                        CVPixelBufferRelease(pixelBuffer);
                 }

             }

because, in some of earlier version OpenCV forgot to release memory upon each append operation to MPEG4 output. May be its your need.