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?

Était-ce utile?

La 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];
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top