1

Using AVCam I'm abel to start and stop video recording. This method to start recording:

-(void)captureOutput:(AVCaptureFileOutput *)captureOutput didStartRecordingToOutputFileAtURL:(NSURL *)fileURL fromConnections:(NSArray *)connections;

and to stop recording :

-(void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:(NSError *)error;

My question is how can I pause recording? looking into the AVFoundation I can found a pause method which is :

-(void)captureOutput:(AVCaptureFileOutput *)captureOutput didPauseRecordingToOutputFileAtURL:(NSURL *)fileURL fromConnections:(NSArray *)connections

but I can't find a way to make it function. I searched a lot but nothing seemed to solve my problem, so please help. Thank you in advance.

R.AlAli
  • 85
  • 2
  • 10

1 Answers1

0

What about changing the method From AVCam to CameraEngine?

    #import "CameraEngine.h"


- (void) startPreview
{
    AVCaptureVideoPreviewLayer* preview = [[CameraEngine engine] getPreviewLayer];
    [preview removeFromSuperlayer];
    preview.frame = self.cameraView.bounds;
    [[preview connection] setVideoOrientation:UIInterfaceOrientationLandscapeRight];

    [self.cameraView.layer addSublayer:preview];
}



    - (IBAction)startRecording:(id)sender
    {
        [[CameraEngine engine] startCapture];
    }

    - (IBAction)pauseRecording:(id)sender
    {
        [[CameraEngine engine] pauseCapture];
    }

    - (IBAction)stopRecording:(id)sender
    {
        [[CameraEngine engine] stopCapture];
    }
    - (IBAction)resumeRecording:(id)sender
    {
        [[CameraEngine engine] resumeCapture];
    }
Ofir Malachi
  • 1,145
  • 14
  • 20
  • Thank you. Solved it using [link](https://github.com/piemonte/PBJVision). I'll try your suggestion another time. – R.AlAli Jun 06 '17 at 13:46