Search code examples
live-streaminghttp-live-streamingm3u8

Infinite live HLS (handle EXT-X-MEDIA-SEQUENCE overflow)


I want to simulate an infinite live streaming using HLS. Currently I am writing manually a .m3u8 file and the .ts files are loaded from an external service that provides infinite fragments.

This is an example of a m3u8 file:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:22730
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:7
#EXTINF:6,            
asd5.ts
#EXTINF:3,
asd6.ts
#EXT-X-DISCONTINUITY
#EXTINF:6,
xyz1.ts

I am increasing #EXT-X-MEDIA-SEQUENCE with a counter but I am asking what happen when it will reach its maximum value.


Solution

  • There is nothing in the spec that specifies a limit, so every player will respond differently.

    Trying setting it to possible maximums (65535, 4294967295, etc) and see what happens.

    In the real world however, you will reach practical limits before you reach technical limits. (e.g. there Is no practical reason to have a stream that lasts 100 years)