如何从 -captureOutput:didOutputSampleBuffer:fromConnection 中捕获的帧制作电影并保存到照片库?
谢谢你。
抱歉我没注意。请参阅编辑后的答案,也许您会觉得它很有用。
- (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 ];
}