Skip to content
Bernhard Widtmann edited this page Dec 21, 2015 · 19 revisions

ABR (Adaptive Bitrate) describes the logic to determine the best quality (video and audio) without stalling the playback.

Basically the adaption logic in dash.js v1.5 is handled by 4 rules (see ABRRulesCollection.js):

Primary bandwidth based rules:

ThroughputRule uses recent past calculated throughput to predict the near future's throughput. We average the last X (default is 3) segments to smooth out some VBR and network variations. This rule is mostly for up switching.

AbandonRequestsRule is tracking the real time throughput of each segment download. If the estimated time of download gets significant higher (default is 1.5 x segment duration) than the segment duration, the algorithm abandons the download instantly and re-downloads the same segment at lower quality trying to prevent buffer underrun error. The new quality should be the best suited based on the real time (not averaged) throughput measurements prior. This rule is very important in case of instant bandwidth drops. This rule is mostly for down switching.

Secondary buffer based rules:

BufferOccupancyRule is there to override the ThroughputRule when it requests a switch down. This will only happen when we have enough buffer occupancy to absorb a few slower downloads to maintain higher quality to see if we can ride it out until the throughput increases again. This rule is an outside case for preventing oscillation in case of bandwidth spikes.

InsufficientBufferRule forces a switch to lowest quality when buffer gets empty. This is a last resort to get data as fast as possible to resume streaming. This rule is just an emergency rule if we stall.

If our buffer falls below RICH_BUFFER_LEVEL then the buffer based rules do not fire at all.

Visual Overview:

https://docs.google.com/drawings/d/16_EztksKjiZSF0HdjR44soAs7x8QewwlqnABnqjhyk4/edit?usp=sharing

Clone this wiki locally