AVPlayer throwing: "Internal error: restarting too far ahead"

I watch KVO AVPlayerItemNewErrorLogEntryNotification AVPlayer and find the following error:

  • errorStatusCode: -12645 errorDomain: CoreMediaErrorDomain errorComment: Internal error: restarting too far ahead (-1.4084s)

I can't figure out what the bottom line really means.

"Internal error: restarting too far ahead"

Can someone help me find the root cause of this problem.

+5
source share
2 answers

According to an Apple employee, this error message means that:

The player complains that he was trying to restart the live broadcast, but there was only 1.4 seconds of material available. How many segments are in your live playlist? These days, we recommend that you always have less than six segments in a playlist. I believe the only effect is to delay the palyback until there is enough data.

Source: https://forums.developer.apple.com/thread/40791


The cause of the error is most likely m3u8 itself.

When streaming a live program (such as any television channel), there is a delay between the availability of event data and the encoder that creates the media segments (.ts), which are then added to the playlist.

I could imagine that these types of errors are generated if the playItem position of the playhead is at the very edge of the buffer, and new media segments are not sufficiently accessible on the server.


If these errors are prevented or handled by the client:

Since these errors are reported as internal , and AVPlayer seems to be recovering from it, we can safely assume that they are handled internally. Therefore, they could be understood as simple error messages, and they could be ignored.

If someone wants to prevent them, the only way to do this could be to manually edit the edge of the active buffer in time for a few seconds.

+3
source

If a long .ts video file responds with: -12645.

There is no documentation for error status codes returned by MPMediaPlayer in the MPMovieErrorLogEvent class. But some of them:

 HTTP status - errorStatusCode - errorDomain - errorComment 400 -12666 CoreMediaErrorDomain unrecognized http response 400 401 -12937 CoreMediaErrorDomain Authentication Error 402 -12666 CoreMediaErrorDomain unrecognized http response 402 403 -12660 CoreMediaErrorDomain HTTP 403: Forbidden 404 -12938 CoreMediaErrorDomain HTTP 404: File not found 405 -12666 CoreMediaErrorDomain unrecognized http response 405 406 -12666 CoreMediaErrorDomain unrecognized http response 406 407 -12937 CoreMediaErrorDomain Authentication Error 409 -12666 CoreMediaErrorDomain unrecognized http response 409 ... 415 -12666 CoreMediaErrorDomain unrecognized http response 415 500 -12666 CoreMediaErrorDomain unrecognized http response 500 501 -12666 CoreMediaErrorDomain unrecognized http response 501 502 -12666 CoreMediaErrorDomain unrecognized http response 502 503 -12661 CoreMediaErrorDomain HTTP 503: Unavailable 504 -12666 CoreMediaErrorDomain unrecognized http response 504 505 -12666 CoreMediaErrorDomain unrecognized http response 505 if long .ts video file respons -12645 CoreMediaErrorDomain No response for media file in 10 s video .ts file bitrate differ from m3u8 declaration -12318 CoreMediaErrorDomain Segment exceeds specified bandwidth for variant for live stream.playlist m3u8 did not change too long -12642 CoreMediaErrorDomain Playlist File unchanged for 2 consecutive reads if wrong host ip -1004 kCFErrorDomainCFNetwork - if wrong dns host name -1003 kCFErrorDomainCFNetwork - if bad formatted URL -1000 kCFErrorDomainCFNetwork - if invalid https/ssl request -1202 kCFErrorDomainCFNetwork - 
+4
source

Source: https://habr.com/ru/post/1244620/


All Articles