Skip to content

Commit

Permalink
Add description for insufficient-buffer-rule.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed Jan 26, 2024
1 parent eea1e4a commit 3b950bc
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 8 deletions.
55 changes: 55 additions & 0 deletions pages/advanced/abr/insufficient-buffer-rule.md
@@ -0,0 +1,55 @@
---
layout: default
title: InsufficientBufferRule
parent: Adaptive Bitrate Streaming
grand_parent: Advanced Features
---

# InsufficientBufferRule

## Description

The `InsufficientBufferRule` verifies each ABR choice to make sure the download is unlikely
to cause a rebuffering event. The rule is best explained by looking at a concrete example. Assume the following values:

* `currentThroughput` = 5Mbit/s
* `currentSafeThroughput` = `currentThroughput` * `throughputSafetyFactor` = 5Mbit/s * 0.9 = 4.5 Mbit/s
* `currentBufferLevel` = 10 seconds
* `segmentDuration` = 4 seconds

To avoid a buffer underrun we need to finish the download of the next segment in 10 seconds. This means we need to
download 4 seconds of content in 10 seconds. This leads us to the following expression that we need to solve:

`possibleBitrate <= currentSafeThroughput * currentBufferLevel / segmentDuration`

Plugging the examples values from above we get:

`possibleBitrate <= 4.5 Mbit/s * 10s / 4s`

So in this case we can select a maximum bitrate of `11.25 Mbit/s`.

## Configuration Options

| Parameter | Description |
|:-------------------------|:--------------------------------------------------------------------------------------------------------------------------|
| `throughputSafetyFactor` | The safety factor that is applied to the derived throughput, see example in the Description. |
| `segmentIgnoreCount` | This rule is not taken into account until the first `segmentIgnoreCount` media segments have been appended to the buffer. |

## Example

```js
player.updateSettings({
streaming: {
abr: {
activeRules: {
insufficientBufferRule: {
active: true,
parameters: {
throughputSafetyFactor: 0.9,
}
}
}
}
}
});
```
16 changes: 8 additions & 8 deletions pages/advanced/abr/settings.md
Expand Up @@ -88,14 +88,14 @@ player.updateSettings({
});
```

| ABR Rule | Description |
|:-------------------------|:------------------------------------------------|
| `insufficientBufferRule` | tbd |
| `switchHistoryRule` | tbd |
| `droppedFramesRule` | tbd |
| `abandonRequestsRule` | [AbandonRequestRule](abandon-request-rule.html) |
| `l2ARule` | [L2ARule](l2a.html) |
| `loLPRule` | [LoL+](lol_plus.html) |
| ABR Rule | Description |
|:-------------------------|:--------------------------------------------------------|
| `insufficientBufferRule` | [InsufficientBufferRule](insufficient-buffer-rule.html) |
| `switchHistoryRule` | tbd |
| `droppedFramesRule` | tbd |
| `abandonRequestsRule` | [AbandonRequestRule](abandon-request-rule.html) |
| `l2ARule` | [L2ARule](l2a.html) |
| `loLPRule` | [LoL+](lol_plus.html) |

A detailed example is available [here](https://reference.dashif.org/dash.js/nightly/samples/abr/abr.html).

Expand Down

0 comments on commit 3b950bc

Please sign in to comment.