我已经设置了输入,AVCapture会话的输出以及代理
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
正在被召唤。如何将帧转换为mp4视频文件并保存?
答案 0 :(得分:2)
使用AVAssetWriter压缩数据并写入MP4。这两个示例包含执行此操作的代码:
http://www.gdcl.co.uk/2013/02/20/iPhone-Pause.html
http://www.gdcl.co.uk/2013/02/20/iOS-Video-Encoding.html