2

I'm having an error when I'm recording a long video. The weird thing is this happens always when I have been recording for 1 hour and 30 min aprox.

I'm recording a video and two audio tracks using 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)"}})

I have tried to find this error code in https://www.osstatus.com/ but no luck.

Any help would be appreciated

Pablo Martinez
  • 1,573
  • 12
  • 31

1 Answers1

0

I just had this issue and it seems I was using the wrong output settings for AVAssetReaderTrackOutput.

In my case, I made it work using

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)
Juan Giorello
  • 333
  • 2
  • 13