iOS 13 beta, Error Domain=NSOSStatusErrorDomain Code=-16345 "(null)"

For iOS 13 beta.

I'm using AVAssetWriter writing CMSampleBuffer from CGImage to mp4 file, but occasinally this error occurs:


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



what does code = -16345 mean? where can I get those errors' description documents?

With great appreciate for your help.

Replies

Hi, dimsky


I got the same error and finally fixed it.


The detail of error is:

[00:02:09.377] MovieHeaderMakerCopyMovieHeaderAsBlockBuffer signalled err=-16345 (kMovieHeaderMakerError_InvalidFileExtension) (file format and file extension of destination URL doesn't match) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMedia/EmbeddedCoreMedia-2479.1.3/Prototypes/FormatHandlers/Movie/MovieHeaderMaker.c:1463


PS. I found the error info from Console.app with iOS 13 beta device log.


So the solution is obvious:

* Check AVFileType, which was set to AVAssetWriter, make sure it matches destinationURL extension. e.g. AVFileType.mp4 should match the file extension ".mp4".

I tried AVFileType.mov with ".mp4" file extension on iOS 12, it worked fine. But it failed on iOS 13.


Hope this help 🙂

Thank you, worked! You just saved my day 🙂