gpt4 book ai didi

ios - AVCaptureSession 最大持续时间

转载 作者:行者123 更新时间:2023-11-29 03:01:54 25 4
gpt4 key购买 nike

在我的应用程序中,我录制长达 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com