HLS Live Broadcast:跟踪多个客户端

HLS Live Broadcast: Keeping track of multiple client

我正在尝试编写一个具有动态分段的 HLS 服务器。

我面临着弄清楚何时删除旧媒体段以及如何跟踪多个客户端连接和重新加载的起始序列号的问题。

多个客户端可能会在不同的时间点请求同一个流。对于每个客户端,起始序列号可能不同。必须对此进行跟踪,以便在后续重新加载时,段的起始序列号是正确的。

社区里有没有人用过HLS直播?任何指针都会有所帮助。

何时不从播放列表中删除旧媒体片段:

The server MUST NOT remove a media segment from the Playlist file if the duration of the Playlist file minus the duration of the segment is less than three times the target duration.

从磁盘中删除旧片段:TTL 是播放列表长度的两倍

对于播放列表中每个删除的片段(滑动 window)媒体序列递增 1 的 LIVE 播放列表,该值对于同一流的所有客户端都是相同的。你不应该包装媒体序列,使用 UINT64。

来源:https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-13