How to save video (mp4 format) using AVCaptureVideoDataOutput?

I set the input and output for the AVCapture session as well as the delegate

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection 

called out. How to convert frames to mp4 video file and save it?

+4
source share
1 answer

Use AVAssetWriter to compress data and write to MP4. These two examples contain code that does this:

http://www.gdcl.co.uk/2013/02/20/iPhone-Pause.html

http://www.gdcl.co.uk/2013/02/20/iOS-Video-Encoding.html

WITH

+2
source

All Articles