Question

In my app I am recording video of up to 30 seconds. I used the following line to do this.

[imagePicker setVideoMaximumDuration:30];

Every thing was working fine. Then I decided to move from UIImagePickerController to AVCaptureSession, It successfully changed every thing but could not set the MaximumDuration. Is there any parameter/workaround which can set this?

Was it helpful?

Solution

AVCaptureMovieFileOutput *aMovieFileOutput = [[AVCaptureMovieFileOutput alloc] init];
CMTime maxDuration = <#Create a CMTime to represent the maximum duration#>;
aMovieFileOutput.maxRecordedDuration = maxDuration;
aMovieFileOutput.minFreeDiskSpaceLimit = <#An appropriate minimum given the quality of the movie format and the duration#>;

For further details look at here

ALSO try NSTimer to setup camera actions

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top