When an ABR client switches from one bitrate to another, how does it know which is the next segment to fetch specially if the segment names are not indicative of any order? e.g. Lets say, segment 1 and 2 have been read for bitrate x, and now the client decides that segment 3 should be read from the child manifest for bitrate y, how does it know which entry to read in the child manifest to get the url of segment3 with bitrate y?
Asked
Active
Viewed 153 times
2 Answers
0
Every implementation is different, But often, the ABR algorithm just estimates the bit rate, The manifest has a list segments per bitrate. As time (inevitably) moves forward, and the next segment is due to download, to player picks the next one form the list at the highest possible bitrate given the output of the ABR.

szatmary
- 29,969
- 8
- 44
- 57
-
yeah, but how does it know which is the next segment from the playlist file it is switching to since each segment can potentially be of different duration in each manifest. – Vishal Jan 24 '19 at 21:33
-
so the client would need to sum up all the durations in a child playlist to find which segment to select, if switching in between from one bitrate to another? – Vishal Jan 25 '19 at 18:47
0
As I know from the source code in hls.js and exoplayer(HlsMediaSource), the client chooses the next chunk based on the end time of current buffer, then find the segment which contains the end time in m3u8 by binary searching.

slzy
- 66
- 2