我正在AVMutableComposition
从视频和音轨创建:
func makeComposition(videoTrack: AVAssetTrack, audioTrack: AVAssetTrack) -> AVComposition {
let composition = AVMutableComposition()
/* ... */
let compositionAudioTrack = composition.addMutableTrack(withMediaType: .audio)!
try compositionAudioTrack.insertTimeRange(someRange, of: audioTrack, at: .zero) // Error!
/* ... */
return composition
}
并insertTimeRange(_:of:at:)
以 AVFoundationError -11800AVError.code.unknown
和未记录的底层NSOSStatusError
-12780 失败。可能是什么情况?