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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top