It's very hard to know from AVFoundation error codes what is the exact error. For instance, I see the following message and don't know what error code means?
Asked
Active
Viewed 217 times
1 Answers
2
-11800/-16364
is the error -16364
wrapped in the AVFoundation
error -11800
(AVErrorUnknown
).
As far as I can tell -16364
is undocumented, but I associate it with timestamp misuses, like trying to encode CMSampleBuffer
s with non strictly monotonic increasing timestamps (repeating or decreasing).
I guess that means the error originates in CoreMedia
or VideoToolbox
or something similar.

Rhythmic Fistman
- 34,352
- 5
- 87
- 159
-
Saved me a week! Also, in addition to this answer: Try to debug this by appending timestamps to array, but NOT by comparing latest two. You can track duplication in the last of 10 or 20, because AVAssetWriter (or encoder) has its own internal queue, so you can append some frames after some illegal sequence of timestamps, and get .failure status a bit later, what actually confuses. – Nikolay Tabunchenko Oct 17 '22 at 23:31