iPhone: 5 seconds video capture
Asked Answered
H

1

2

I would like to write code so that when the user presses a button, the camera is launched and records 5 seconds of video. In other words I want to have video capture but with a time limit.

Is there something inside the UIImagePickerController or other parts of the framework that would allow doing this? Thank you.

Hagiolatry answered 30/4, 2011 at 1:5 Comment(0)
S
3

There is nothing that allows you to directly do this. But you can very easily use UIImagePickerController's startVideoCapture to begin the capture and then call stopVideoCapture 5 seconds later, for example with [picker performSelector:@selector(stopVideoCapture) withObject:nil afterDelay:5].

Or you can do basically the same thing with AVFoundation, in particular AVCaptureMovieFileOutput's startRecordingToOutputFileURL:recordingDelegate: and stopRecording methods.

Sperry answered 30/4, 2011 at 1:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.