hls.js icon indicating copy to clipboard operation
hls.js copied to clipboard

Understanding variant synchronization

Open jagadishkamathk opened this issue 6 years ago • 3 comments

Apologies if this question has been asked in the past. I'm seeking some advice on variant synchronization in HLS

The standard clearly says

A client MUST NOT assume that segments with the same Media Sequence
Number in different Variant Streams or Renditions have the same
position in the presentation; Playlists MAY have independent Media
Sequence Numbers.  Instead, a client MUST use the relative position
of each segment on the Playlist timeline and its Discontinuity
Sequence Number to locate corresponding segments

How can the client find relative position of a segment on the playlist? Let us assume I fetch 240p of a live stream

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:335
#EXT-X-TARGETDURATION:5
#EXTINF:4.000,
335.ts
#EXTINF:4.767,
336.ts
#EXTINF:3.100,
337.ts

And then I fetch 720p because I have better network which gives me

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:336
#EXT-X-TARGETDURATION:5
#EXTINF:4.767,
336.ts
#EXTINF:3.100,
337.ts
#EXTINF:3.066,
338.ts

Without using mediaSequenceNumber as the base, how can one find the relative position of the segment?

What do you want to do with Hls.js? Use it as a player for my live stream

What have you tried so far? Embedded the player and provided my HLS stream to hlsjs script for playing live

jagadishkamathk avatar Apr 27 '20 14:04 jagadishkamathk

a client MUST use the relative position of each segment on the Playlist timeline

I don't think the above applies to live streams with moving windows.

and its Discontinuity Sequence Number

These must align and within a discontinuity sequence presentation time stamps (PTS) should align.

robwalch avatar Apr 30 '20 23:04 robwalch

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar May 22 '20 06:05 stale[bot]

This issue has been automatically closed because it has not had recent activity. If this issue is still valid, please ping a maintainer and ask them to label it accordingly.

stale[bot] avatar May 25 '20 07:05 stale[bot]