Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I pause video at the exact moment I capture a photo?

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?

like image 332
user1130254 Avatar asked Jul 27 '12 13:07

user1130254


People also ask

How do you pause a video screenshot?

Press ALT+PRINT SCREEN. Play the video and pause it at the point you want to take a still from it. Press PRINT SCREEN or ALT+PRINT SCREEN, depending on whether the video is playing full screen or in an active window.

How do you pause and resume video on iPhone 11?

Tap the Record button at the bottom to begin recording. When you need to pause, just tap the Pause button that has replaced the record button. Tap the Record button to pick back up where you left off. Once you've finished recording, tap the checkmark icon in the top right corner.


1 Answers

Almost a year later...Your approach is all wrong. Instead of trying to pause the video at the precise moment that the image is captured why don't you pause the video and then capture that paused image. To a user it makes no difference, to a developer you don't have to worry about exact precision.

To reiterate my idea, if you pause a video and flash white visual and play a click the user will think you have just captured that frame regardless if you are or not. Actually, you could consider pausing video the same as capturing an image without saving it.

like image 161
Gallonallen Avatar answered Nov 15 '22 06:11

Gallonallen