이 확장 프로그램을 사용하여 AVAsset
의 비디오 파일을 tmp 폴더에 저장합니다. "작업이 을 완료 할 수 없습니다"AVAssetExportPreset 유형의 AVAssetExportSession 문제
오류 도메인 = AVFoundationErrorDomain 코드 = -11800 사용자 정보 = {NSUnderlyingError = 0x1748482e0 {: 문제는 내가
AVAssetExportPresetHighestQuality
유형의 비디오 파일을 사용하고 있습니다 때하는 것은 인해 그 이유를 저장할 수 없습니다이다 오류 도메인 = NSOSStatusErrorDomain 코드 = -12780는 "(널)는"}, NSLocalizedFailureReason는 NSLocalizedDescription이 경우에도 또한
몇 번을} 작업을 완료 할 수 없습니다 = 알 수없는 오류가 발생 (-12780)를 = I AVAssetExportPresetHighestQuality
sa를 사용하고 있습니다. 비디오는 임의의 순서로 표시됩니다.
extension AVAsset {
func write(to url: URL, success: @escaping() ->(), failure: @escaping (Error) ->()) {
guard let exportSession = AVAssetExportSession(asset: self, presetName: AVAssetExportPresetMediumQuality) else {
let error = NSError(domain: "domain", code: 0, userInfo: nil)
failure(error)
return
}
exportSession.outputFileType = AVFileTypeMPEG4
exportSession.outputURL = url
exportSession.exportAsynchronously {
switch exportSession.status {
case .completed:
success()
case .unknown, .waiting, .exporting, .failed, .cancelled:
let error = NSError(domain: "domain", code: 0, userInfo: nil)
failure(error)
}
}
}
}