如何避免使用 Flowplayer 进行直播播放时累积延迟?

发布于 2024-11-05 13:54:03 字数 457 浏览 5 评论 0原文

我正在尝试使用 FlowPlayer 在我的网页(或更准确地说,我的网络应用程序)上播放音频直播。包含应用程序和播放器的页面应该长时间保持打开状态,比如几个小时,经过一系列测试后,我意识到播放器会不断缓冲音频流,并在每次丢失某些包时延迟播放(我想这发生的原因是由于我的连接不稳定导致包丢失)。几个小时后,流延迟从原来的 1-2 秒增加到了大约 30-35 秒的延迟。

所以,我想要实现的是:每当某些丢失的包会导致音频流延迟时,音频流都会避免此错误,甚至导致音频跳跃,但不会堆积任何延误。

我搜索了整个文档,我能找到的关于这个参数的唯一信息是关于缓冲区长度的。实际上,由于我的实时需求,我将 bufferLength 设置为 2(使用默认值 3 时,我有 5-6 秒的基本延迟,这对于我尝试的应用程序类型来说是不可接受的) run),但我无法找到避免延迟堆积的确定方法。

我使用 RTMP 协议从 Wowza 2.0 服务器捕获实时流。

I'm trying to use FlowPlayer to play an audio livestream on my web page (or to be more precise, my web application). The page containing both application and player is supposed to be kept open for long times, like hours, and after a bunch of test I realized the player keeps buffering the audio stream and playing it with delay every time some package was missing (I suppose this happened because of package missing due to instability of my connection). After a bunch of hours, from the original 1-2 second, the stream had piled up something like 30-35 seconds delay.

So, what I'm trying to achieve is: anytime some missing package would cause a delay in the audio stream, the audio stream would avoid this error, even causing the audio to jump, but without piling up any delay.

I searched all over the documentation and the only information about this argument I was able to find was about the buffer length. I actually set the bufferLength to 2, due to my real-time needs (with the default 3 value I had a base 5-6 second delay, not acceptable for the kind of application I'm trying to run), but I can't get a sure method to avoid delay piling.

I catch my real-time stream from a Wowza 2.0 server, using RTMP protocol.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谜兔 2024-11-12 13:54:03

我终于让它工作了,我只是将缓冲区长度设置为较低的数字(准确地说是 1),并向事件处理程序“onEmptyBuffer”添加刷新函数,这样每次延迟开始堆积时,播放器都会刷新并返回延迟 1-2 秒。这样我只会因为刷新而损失 1-2 秒的通信时间(在我的案例研究中并没有那么糟糕),尽管我的延迟不会高于原来的 2-3 秒。

I finally got it to work, I just set my buffer lenght to a lower number (1 to be precise) and added a refresh function to the event handler "onEmptyBuffer" this way every time delay starts piling up, the player refreshes and get back to a 1-2sec delay. This way i only lose 1-2 seconds of communication due to refresh (not so terrible in my case study) though I won't have a delay higher than the original 2-3sec.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文