AVPlayer抛出:“内部错误:重启太远" [英] AVPlayer throwing : "Internal error: restarting too far ahead"

查看:85
本文介绍了AVPlayer抛出:“内部错误:重启太远"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在观察AVPlayer的KVO AVPlayerItemNewErrorLogEntryNotification,发现以下错误:

I am observing KVO AVPlayerItemNewErrorLogEntryNotification of the AVPlayer and I find the following error:

errorStatusCode:-12645 errorDomain:CoreMediaErrorDomainerrorComment:内部错误:重启得太早了(-1.4084s)

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

我无法理解以下内容的真正含义.

I am unable to understand what the below line really means.

内部错误:重启得太早了"

"Internal error: restarting too far ahead"

任何人都可以帮助我找到此问题的根本原因.

Can anyone help me to find the root cause of this issue.

推荐答案

根据Apple员工的说法,该错误消息表示:

According to an Apple employee this error message means that:

播放器在抱怨它试图重新开始直播,但只有1.4秒的可用材料.有多少段在您的现场播放列表中?这些天,我们建议您始终在播放列表中的至少六个细分.我相信唯一的效果是延迟回传,直到它有足够的数据为止.

The player is complaining that it was trying to restart a live stream, but only had 1.4 seconds of material available. How many segments are in your live playlist? These days we recommend that you always have at least six segments in the playlist. I believe the only effect is to delay palyback until it has enough data.

来源: https://forums.developer.apple.com/thread/40791

在流式传输直播节目(例如任何电视频道)时,事件数据的可用性与编码器创建媒体片段(.ts)并随后附加到播放列表之间会有一定的延迟.

When streaming a live program (e.g. any TV channel) there is a delay between the availability of event data and the encoder creating media segments (.ts) that are then appended to the playlist.

我可以想象,如果playerItem播放头的位置在缓冲区的最边缘并且服务器上没有足够快地提供新的媒体段,则会产生这些类型的错误.

I could imagine that these types of errors are generated if the playerItem playhead's position is at the very edge of the buffer and new media segments are not made available fast enough on the server.

由于这些错误被报告为 internal ,并且AVPlayer显然已从中恢复,因此可以安全地假定它们是在内部处理的.因此,可以将它们理解为简单的错误报告,并且可以选择忽略它们.

Since these errors are reported as internal and AVPlayer apparently recovers from it, it is safe to assume that they are being handled internally. They could therefore be understood as simple error reporting and one could choose to ignore them.

如果要阻止它们,唯一的方法可能是手动将实时缓冲区的边缘设置为几秒钟.

If one wanted to prevent them, the only way to do this might be to manually set the live buffer's edge back in time a few seconds.

这篇关于AVPlayer抛出:“内部错误:重启太远"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆