如何使用 AVFoundation 修剪视频
我可以使用 AVFoundation 或 UIImagePickerController 录制视频。但我无法将视频从某一特定秒修剪到另一个特定持续时间/时间。任何人都可以帮助我吗?
谢谢, 湿婆克里希纳。
Iam able to record the video by using AVFoundation or UIImagePickerController. But i am unable to trim the video from one particular second to another particular duration/time. Can any one help me.
Thanks,
Siva Krishna.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以让 UIImagePickerController 启用修剪功能,
但不幸的是,从 imagePickerController 返回后,您将被迫手动转换视频。
You can have the UIImagePickerController enable trimming
Unfortunately after you get back from the imagePickerController, You are forced to convert the video manually.
上述的 Swift 版本
Swift version of above
swift 4的最佳解决方案,我找到了那里。我确实根据我的需要修复了它,但它确实很清晰和方便。
代码:
The best solution for swift 4, i have found there. I did fixes it for my needs, but it's really clear and convenience.
The code:
您应该将 kUTTypeMovie 添加到 setMediaTypes 数组中,它将起作用。
you should add kUTTypeMovie in the setMediaTypes array and it will work.