如何从中捕获的帧制作电影 -captureOutput:didOutputSampleBuffer:fromConnection 并保存到照片库?
谢谢。
答案 0 :(得分:0)
抱歉,我没有注意到。看到编辑过的答案,也许你觉得它很有用。
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {
CVPixelBufferRef pixelBuffer = (CVPixelBufferRef) CMSampleBufferGetImageBuffer(sampleBuffer);
CIImage *image = [CIImage imageWithCVPixelBuffer:pixelBuffer];
[_coreImageContext drawImage:image inRect:[image extent] fromRect:[image extent]];
[_context presentRenderbuffer:GL_RENDERBUFFER ];
}