I am using AVFoundation
to display a Video in my UIView
via an AVCaptureVideoPreviewOverlay
.
I then use AVStillImageOutput
's -
captureStillImageAsynchronouslyFromConnection:
to capture a still Image from the Video with the AVCaptureSessionPresetPhoto
preset.
I am freezing the video using AVCaptureSession
's -
stopRunning in the -
captureStillImageAsynchronouslyFromConnection completion block mentioned earlier. However, it's too late and the video has continued running while the still image is taken, so the freeze is a second or two later. When I display the image there is a jump.
How can I freeze the video at the exact moment the photo is taken?