Сделать видео из кадров, захваченных в captureOutput:didOutputSampleBuffer:fromConnection
Как сделать фильм из кадров, снятых в -captureOutput:didOutputSampleBuffer:fromConnection и сохранить в библиотеку фотографий?
Благодарю вас.
1 ответ
Извините, я не заметил. Смотрите отредактированный ответ, может быть, вы найдете его полезным.
- (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 ];
}