我希望能够从照片库中选择一个视频,并从现有剪辑中挑选出 15 秒的视频。有没有办法强制修剪为固定长度?
最佳答案
设置UIImagePickerController
属性(property),videoMaximumDuration
到你想要的固定长度。来自文档:
The maximum duration, in seconds, for a video recording.
@property(非原子)NSTimeInterval videoMaximumDuration
讨论
The default value for this property is 10 minutes (600 seconds). When a user taps the Share button to send a movie to MMS, MobileMe, YouTube, or another destination, an appropriate duration limit and an appropriate video quality are enforced.
This property is available only if the mediaTypes property’s value array includes the kUTTypeMovie media type.
关于iOS 将视频修剪为固定长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14871379/