kroumvud kroumvud - 1 year ago 135
iOS Question

ios - Pause video recording

I'm try to create application where user can record video from camera.
One of the feature of this application must be a pause file recording.
For example:
User start record after pressing "Start" button. After some time user press "Pause" button and video recording paused. Then user press "Resume" button and video continue recording in the same file.
Can any body help me?
Thank you.


Answer Source

Set up an AVCaptureSession and a AVAssetWriter then you can switch the recording on an off with the boolean "isRecording".

 BOOL isRecording;

-(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
     if(videoWriterInput.readyForMoreMediaData && isRecording) [videoWriterInput appendSampleBuffer:sampleBuffer];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download