【问题标题】:Error on PHPhotoLibrary, cannot save videoPHPhotoLibrary 出错,无法保存视频
【发布时间】:2020-05-31 16:01:52
【问题描述】:

我正在尝试将视频保存在我的照片库中。但有时我得到一个错误:操作无法完成。 (PHPhotosErrorDomain 错误 -1。)

这是我的代码:

PHPhotoLibrary.shared().performChanges({
            PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: exporter!.outputURL!)
               }) { saved, error in
                   if saved {
                       print("video saved to camera roll")
                   } else {
                    print(error?.localizedDescription)
                }
               }

【问题讨论】:

  • 你有什么解决办法吗?我也面临同样的错误。
  • 你的问题解决了吗?

标签: swift iphone xcode phphotolibrary


【解决方案1】:

我能够通过在 AVAssetWriter 的视频输出设置中删除 AVVideoCompressionPropertiesKey 中的 AVVideoQualityKey 来解决此问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-05-27
    • 2015-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多