Here i am trying to record video and process output buffers , i am using avfoundation camera to record video and collecting output at sample buffer delegate method and displaying that output in image view.every thing works find but the thing how to save video from here can any one please help me.
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection;{
UIImage *image = [self imageFromSampleBuffer:sampleBuffer];
UIImage *fImage = [self addText:image text:@"u r text here"];//image will be processed here
self.dispFrames.image = fImage;
}
You have to setup AVAssetWriter with Audio/Video inputs and append your sample buffers. You can checkout this sample code, RosyWriterVideoProcessor class https://developer.apple.com/library/ios/samplecode/RosyWriter/Listings/Classes_RosyWriterVideoProcessor_m.html#//apple_ref/doc/uid/DTS40011110-Classes_RosyWriterVideoProcessor_m-DontLinkElementID_8