longitachi / ZLPhotoBrowser

Wechat-like image picker. Support select photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;
MIT License
4.76k stars 963 forks source link

导出指定格式 #755

Closed 979881765 closed 1 year ago

979881765 commented 2 years ago

@objc class func exportVideo(for asset: PHAsset, exportType: ZLVideoManager.ExportType = .mov, presetName: String = AVAssetExportPresetMediumQuality, complete: @escaping ((URL?, Error?) -> Void)) {}

默认导出的是mov,如果exportType设置为mp4,导出的还是mov

longitachi commented 2 years ago

调用时候传什么就是什么,这只是一个导出方法,看外面调用地方传的值

979881765 commented 1 year ago

传的是mp4 导出的是mov

longitachi commented 1 year ago

刚看了下代码,遗留的一个bug,之前创建存储路径方法默认按照 ZLPhotoConfiguration 中的配置走了,下个版本改下

longitachi commented 1 year ago

导出PHAsset对象可以用这个方法 https://github.com/longitachi/ZLPhotoBrowser/blob/657f85e552e1411cabfb859a00c7687577ab4793/Sources/General/ZLPhotoManager.swift#L400-L411 导出的质量是原图质量,导出效率也较高