Merge pull request #230 from videojs/bitrate-switching-docs
Bitrate switching docs
Showing
10 changed files
with
48 additions
and
17 deletions
... | @@ -40,6 +40,10 @@ HLS stream, code against the regular HTML5 video APIs, and create a | ... | @@ -40,6 +40,10 @@ HLS stream, code against the regular HTML5 video APIs, and create a |
40 | fast, high-quality video experience across all the big web device | 40 | fast, high-quality video experience across all the big web device |
41 | categories. | 41 | categories. |
42 | 42 | ||
43 | Check out the [full documentation](docs/) for details on how HLS works | ||
44 | and advanced configuration. A description of the [adaptive switching | ||
45 | behavior](docs/bitrate-switching.md) is available, too. | ||
46 | |||
43 | The videojs-hls tech is still working towards a 1.0 release so it | 47 | The videojs-hls tech is still working towards a 1.0 release so it |
44 | may not fit your requirements today. Specifically, there is _no_ | 48 | may not fit your requirements today. Specifically, there is _no_ |
45 | support for: | 49 | support for: |
... | @@ -198,23 +202,6 @@ configured. Easy [instructions are | ... | @@ -198,23 +202,6 @@ configured. Easy [instructions are |
198 | available](http://enable-cors.org/server.html) for popular webservers | 202 | available](http://enable-cors.org/server.html) for popular webservers |
199 | and most CDNs should have no trouble turning CORS on for your account. | 203 | and most CDNs should have no trouble turning CORS on for your account. |
200 | 204 | ||
201 | ## Adaptive Switching Behavior | ||
202 | The HLS tech tries to ensure the highest-quality viewing experience | ||
203 | possible, given the available bandwidth and encodings. This doesn't | ||
204 | always mean using the highest-bitrate rendition available-- if the player | ||
205 | is 300px by 150px, it would be a big waste of bandwidth to download a 4k | ||
206 | stream. By default, the player attempts to load the highest-bitrate | ||
207 | variant that is less than the most recently detected segment bandwidth, | ||
208 | with one condition: if there are multiple variants with dimensions greater | ||
209 | than the current player size, it will only switch up one size greater | ||
210 | than the current player size. | ||
211 | |||
212 | If you'd like your player to use a different set of priorities, it's | ||
213 | possible to completely replace the rendition selection logic. For | ||
214 | instance, you could always choose the most appropriate rendition by | ||
215 | resolution, even though this might mean more stalls during playback. | ||
216 | See the documentation on `player.hls.selectPlaylist` for more details. | ||
217 | |||
218 | ## Release History | 205 | ## Release History |
219 | - 0.11.0: embedded ID3 tags are exposed as an in-band metadata track | 206 | - 0.11.0: embedded ID3 tags are exposed as an in-band metadata track |
220 | - 0.10.0: optimistic initial bitrate selection | 207 | - 0.10.0: optimistic initial bitrate selection | ... | ... |
docs/bitrate-switching-1.graffle
0 → 100644
No preview for this file type
docs/bitrate-switching-1.png
0 → 100644
32.2 KB
docs/bitrate-switching-2.graffle
0 → 100644
No preview for this file type
docs/bitrate-switching-2.png
0 → 100644
38.5 KB
docs/bitrate-switching-3.graffle
0 → 100644
No preview for this file type
docs/bitrate-switching-3.png
0 → 100644
44.3 KB
docs/bitrate-switching-4.graffle
0 → 100644
No preview for this file type
docs/bitrate-switching-4.png
0 → 100644
41.7 KB
docs/bitrate-switching.md
0 → 100644
1 | # Adaptive Switching Behavior | ||
2 | The HLS tech tries to ensure the highest-quality viewing experience | ||
3 | possible, given the available bandwidth and encodings. This doesn't | ||
4 | always mean using the highest-bitrate rendition available-- if the player | ||
5 | is 300px by 150px, it would be a big waste of bandwidth to download a 4k | ||
6 | stream. By default, the player attempts to load the highest-bitrate | ||
7 | variant that is less than the most recently detected segment bandwidth, | ||
8 | with one condition: if there are multiple variants with dimensions greater | ||
9 | than the current player size, it will only switch up one size greater | ||
10 | than the current player size. | ||
11 | |||
12 | If you're the visual type, the whole process is illustrated | ||
13 | below. Whenever a new segment is downloaded, we calculate the download | ||
14 | bitrate based on the size of the segment and the time it took to | ||
15 | download: | ||
16 | |||
17 | ![New bitrate info is available](bitrate-switching-1.png) | ||
18 | |||
19 | First, we filter out all the renditions that have a higher bitrate | ||
20 | than the new measurement: | ||
21 | |||
22 | ![Bitrate filtering](bitrate-switching-2.png) | ||
23 | |||
24 | Then we get rid of any renditions that are bigger than the current | ||
25 | player dimensions: | ||
26 | |||
27 | ![Resolution filtering](bitrate-switching-3.png) | ||
28 | |||
29 | We don't want to signficant quality drop just because your player is | ||
30 | one pixel too small, so we add back in the next highest | ||
31 | resolution. The highest bitrate rendition that remains is the one that | ||
32 | gets used: | ||
33 | |||
34 | ![Final selection](bitrate-switching-4.png) | ||
35 | |||
36 | If it turns out no rendition is acceptable based on the filtering | ||
37 | described above, the first encoding listed in the master playlist will | ||
38 | be used. | ||
39 | |||
40 | If you'd like your player to use a different set of priorities, it's | ||
41 | possible to completely replace the rendition selection logic. For | ||
42 | instance, you could always choose the most appropriate rendition by | ||
43 | resolution, even though this might mean more stalls during playback. | ||
44 | See the documentation on `player.hls.selectPlaylist` for more details. |
-
Please register or sign in to post a comment