AVPlayerItem Error Code -12814 ?

When playing local video files on a device running iOS, I sometimes encounter the following notification: AVPlayerItemFailedToPlayToEndTime

The error code given in the user info is -12814, but I'm having trouble locating any more info on this error, or ascertaining why the error is occurring. A video file will be playing seemingly without issue and suddenly stop unexpectedly with this error.

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

Any insights would be much appreciated.

I expect it may be significant that there's an AVMutableComposition involved in this issue.

NSConcreteNotification 0x283b85f50 {name = AVPlayerItemFailedToPlayToEndTimeNotification; object = <Muddle.CompositionPlayerItem: 0x283599040, asset = <AVMutableComposition: 0x283567c80 tracks = (   "<AVMutableCompositionTrack: 0x283567ea0 trackID = 1, mediaType = soun, editCount = 1>",   "<AVMutableCompositionTrack: 0x283563a60 trackID = 2000, mediaType = vide, editCount = 1>",   "<AVMutableCompositionTrack: 0x283563b00 trackID = 2001, mediaType = vide, editCount = 0>",   "<AVMutableCompositionTrack: 0x283598320 trackID = 1009, mediaType = vide, editCount = 0>",   "<AVMutableCompositionTrack: 0x283563c60 trackID = 1010, mediaType = vide, editCount = 0>",   "<AVMutableCompositionTrack: 0x283598440 trackID = 1011, mediaType = vide, editCount = 0>",   "<AVMutableCompositionTrack: 0x283598520 trackID = 1012, mediaType = vide, editCount = 0>",   "<AVMutableCompositionTrack: 0x283598600 trackID = 1013, mediaType = vide, editCount = 0>",   "<AVMutableCompositionTrack: 0x283563d20 trackID = 1014, mediaType = vide, editCount = 0>",   "<AVMutableCompositionTrack: 0x283598700 trackID = 1015, mediaType = vide, editCount = 0>" )>>; userInfo = {   AVPlayerItemFailedToPlayToEndTimeErrorKey = "Error Domain=AVFoundationErrorDomain Code=-11800 \"The operation could not be completed\" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-12814), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x283bb55f0 {Error Domain=NSOSStatusErrorDomain Code=-12814 \"(null)\"}}"; }}

CompositionPlayerItem is simply an AVPlayerItem that holds a reference to a composition.

class CompositionPlayerItem : AVPlayerItem {   var composition: AVMutableComposition?

What are the video formats being used in your composition? Also in the meantime, please file a feedback assistant report about the unhelpful error.

All video formats are mp4, but there is a custom compositor (AVVideoCompositing) involved. Playback will be fine for seconds to many minutes, but then it seemingly randomly posts this notification, and then goes south. I expect something is off with the compositor and am hoping getting some information about this mystery error will help point me to the issue.

Documentation has been updated:

Declaration:

AVErrorUnusualSunspotActivity = -12814 AVPlayer is unable to function due to wacky sunspots.

AVErrorCosmicRaysBitflipping = -12815 AVPlayer is unable to function due to an obnoxious pulsars.

AVErrorMogwaiFedAfterMidnight = -12816 AVPlayer is unable to function due to gremlins.

AVErrorSpoopyGhostNuisance = -12817 AVPlayer is unable to function due to cute yet annoying paranormal issues.

Same error here. Only one video cause this error in iPhone12 iOS15.6. Have u solved this error?

AVPlayerItem Error Code -12814 ?
 
 
Q