期望:
PHAsset 保存到沙盒指定目录
实现方法:
- (PHImageRequestID)requestExportSessionForVideo:(PHAsset *)asset options:(nullable PHVideoRequestOptions *)options exportPreset:(NSString *)exportPreset resultHandler:(void (^)(AVAssetExportSession *__nullable exportSession, NSDictionary *__nullable info))resultHandler;
结果:
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-12780), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x28208c600 {Error Domain=NSOSStatusErrorDomain Code=-12780 "(null)"}}
原因:
优先检查路径,AVAssetExportSession的属性outputURL 为[NSURL fileURLWithPath:path], 而不是 [NSURL URLW