根据当前用户数量禁用自适应HLS流
我正计划使用NGINX和RTMP模块构建HTTP实时流媒体服务器,该服务器还使用FFMPEG将传入的流编码为不同的比特率级别,从而为实时视频流提供自适应比特率。
我想做的更多,我找不到任何参考或类似问题,是根据消耗流的当前用户的数量来启用和禁用一个或多个比特率级别。因此,如果我用完了连接大量用户的带宽原因,则服务器可以自动禁用一些比特率级别,而不会产生超过会阻止整个服务的带宽。
有人有任何建议吗?
I'm planning to build an HTTP Live Streaming server, using NGINX and RTMP module, that uses also FFmpeg to encode the incoming stream into different bitrate levels, enabling adaptive bitrate for the live video streaming.
What I want to do more, and I'm not able to find any reference or a similar question, is to enable and disable one or more bitrate levels based on the number of current users consuming the stream. So if I'm running out of bandwidth cause of the high number of users connected, the server can disable automatically some bitrate levels and not incur bandwidth exceeding that will block the whole service.
Does anyone have any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您不会找到一个开箱即用的解决方案,从长远来看,您甚至可能会发现额外的带宽比在解决方案中添加额外的复杂性要便宜。
如果您想自己构建它,那么您可以实时更新正在交付的清单,以删除更高的带宽渲染。
对于实时流,清单或HLS播放列表是每隔几秒钟的更新,其中一个新版本包含实时流中的新段,包括每个带宽变体的版本。
如果您从播放列表中删除了较高的变体,从理论上讲,玩家应该识别这一点,并从可用的带宽中选择下一个段,但是您可能需要使用您使用的播放器对其进行测试,以便验证它可以顺利进行。
I don't think you will find an out of the box solution to this and you may even find that paying for extra bandwidth is cheaper in the long run than adding extra complexity to your solution to provide this.
If you do want to build this yourself then you could update the manifest being delivered in real time to remove the higher bandwidth renditions.
For a live stream the manifest, or HLS playlist, is updates every few seconds with a new version contains the new segments in the live stream, including the versions available for each bandwidth variant.
If you remove the higher variant from the playlist, in theory the player should recognise this and choose the next segment from the available bandwidths, but you would likely need to test it with the player(s) you are using to verify it works smoothly.