Question

I'm trying to create an application where the user can record video from a camera. One of the features of this application must be a pause in file recording.

For example: The user starts recording by pressing the "Start" button. After some time user presses the "Pause" button and video recording is paused. Then user presses the "Resume" button and video continues recording in the same file.

Can anybody help me?

Was it helpful?

Solution

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];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top