2

录制长视频时出现错误。奇怪的是,当我大约录制 1 小时 30 分钟时,总是会发生这种情况。

我正在使用 AVAssetWriter 录制一个视频和两个音轨。

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-16155), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x282fe0e40 {Error Domain=NSOSStatusErrorDomain Code=-16155 "(null)"}})

我试图在https://www.osstatus.com/中找到此错误代码,但没有运气。

任何帮助,将不胜感激

4

1 回答 1

0

我刚遇到这个问题,似乎我为 AVAssetReaderTrackOutput 使用了错误的输出设置。

就我而言,我使用

let decompressionAudioSettings: [String: Any] = [AVFormatIDKey: Int(kAudioFormatLinearPCM)] 
audioReaderOutput = AVAssetReaderTrackOutput(track: audioTrack, outputSettings: decompressionAudioSettings)

let decompressionVideoSettings: [String: Any] = [kCVPixelBufferPixelFormatTypeKey as String: kCVPixelFormatType_32BGRA]
videoReaderOutput = AVAssetReaderTrackOutput(track: videoTrack, outputSettings: decompressionVideoSettings)
于 2021-08-02T13:54:58.497 回答