在我的应用程序中,我录制长达 30 秒的视频。我使用以下行来执行此操作。
[imagePicker setVideoMaximumDuration:30];
一切正常。然后我决定从 UIImagePickerController 迁移到 AVCaptureSession,它成功地改变了所有内容,但无法设置 MaximumDuration。有没有任何参数/解决方法可以设置这个?
最佳答案
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#>;
有关详细信息,请参阅 here
还可以尝试使用 NSTimer
设置相机操作
关于ios - AVCaptureSession 最大持续时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23198311/