Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
ADAPTIVE BITRATE ALGORITHMS: HOW THEY WORK
AND HOW TO OPTIMIZE YOUR STACK
22 juin 2016
Streamroot: Who are we?
PARTNERS
INFINITE POSSIBILITIES, LIMITLESS DELIVERY
Streamroot combines the best of a controlled, ...
Presentation Outline
I. Design goals
II. Components: Constraints & Parameters
Examples: hls.js & dash.js
Basic Algorithms ...
I. Design goals: optimize viewer experience
1. Maximize efficiency – stream at the highest bitrate possible
2. Minimize re...
I. Design goals: why this matters
Views 24 min longer when buffer ratio is < 0.2% for live content
View time drops 40% whe...
II. Components: Constraints and Parameters
CONSTRAINTS PARAMETERS
Screen size / Player size Buffer size
CPU & Dropped fram...
II. Components: constraints
1. Screen & Player Size
Resolution should never be larger than the actual size of the video pl...
Screen & player size: HLS.js
https://github.com/dailymotion/hls.js/blob/master/src/controller/cap-level-controller.js#L68
...
Dropped frames: HLS.js
https://github.com/dailymotion/hls.js/blob/master/src/controller/fps-controller.js#L33
Calculates t...
Startup time strategies
https://github.com/dailymotion/hls.js/blob/master/src/controller/stream-controller.js#L131
https:/...
II. Components: parameters
1. Bandwidth Estimation (goal: maximize bitrate)
Estimate available bandwidth based on prior se...
Bandwidth estimation: HLS.js quantization
https://github.com/dailymotion/hls.js/blob/master/src/controller/abr-controller....
(Bonus) P2P bandwidth estimation: HLS.js
Bandwidth estimation: DASH.JS smoothing
Bandwidth smoothing,
taking the last X segment
estimations into account
https://gi...
Bandwidth fragment abort rule: HLS.js and DASH.JS
https://github.com/dailymotion/hls.js/blob/master/src/controller/abr-con...
(Bonus) DASH.JS complementary buffer-based rules
Prevents from switching
down when buffer is large
enough (mostly for VOD)...
Buffer size based ONLY  no more bandwidth estimations
Uses utility theory to make decisions: configurable tradeoff betwee...
IV. Going further: test and iterate!
You’ve got the power!
- Know what is important to you (buffering, max bitrate, bandwi...
1. Tweak the parameters
https://github.com/dailymotion/hls.js/blob/master/API
.md#fine-tuning
2. Write your own rules!
Abr...
QUESTIONS?
Guess what?
We’re Hiring!
Core JavaScript ■ Backend Scalability ■ Junior Software Developer ■ Presales & Support
http://ww...
Further Reading / Contact Us
Probe and Adapt: Rate Adaptation for HTTP Video Streaming At Scale. Zhi Li, Xiaoqing Zhu, Jos...
Upcoming SlideShare
Loading in …5
×

Paris Video Tech - 1st Edition: Streamroot, Adaptive Bitrate Algorithms: comment ca marche, et comment les optimiser dans votre player HTML5

Nous ferons une rapide explication des enjeux et mécanismes de l'Adaptive Bitrate Streaming, puis allons regarder les implémentations pratiques dans les media engines de référence dash.js et hls.js.

  • Be the first to comment

Paris Video Tech - 1st Edition: Streamroot, Adaptive Bitrate Algorithms: comment ca marche, et comment les optimiser dans votre player HTML5

  1. 1. ADAPTIVE BITRATE ALGORITHMS: HOW THEY WORK AND HOW TO OPTIMIZE YOUR STACK 22 juin 2016
  2. 2. Streamroot: Who are we? PARTNERS INFINITE POSSIBILITIES, LIMITLESS DELIVERY Streamroot combines the best of a controlled, centralized network with the resilience and scalability of a widely distributed delivery architecture.
  3. 3. Presentation Outline I. Design goals II. Components: Constraints & Parameters Examples: hls.js & dash.js Basic Algorithms + improvements: smoothing, quantizing, scheduling III. Going further Another Approach: buffer levels The key to improving: testing and iterating
  4. 4. I. Design goals: optimize viewer experience 1. Maximize efficiency – stream at the highest bitrate possible 2. Minimize rebuffering – avoid underrun and playback stalls 3. Encourage stability – switch only when necessary (4. Promote fairness across network bottlenecks)
  5. 5. I. Design goals: why this matters Views 24 min longer when buffer ratio is < 0.2% for live content View time drops 40% when > 0.4% buffer ratio mark Buffer ratio vs. play time Source: NPAW aggregated data for a set of European live broadcasters
  6. 6. II. Components: Constraints and Parameters CONSTRAINTS PARAMETERS Screen size / Player size Buffer size CPU & Dropped frame threshold Bandwidth & possible bitrate Startup time / Rebuffering recovery (Bonus: P2P Bandwidth)
  7. 7. II. Components: constraints 1. Screen & Player Size Resolution should never be larger than the actual size of the video player 2. CPU & Dropped frames Downgrade when too many dropped frames per second 3. Startup time Always fetch the lowest quality first whenever the buffer is empty
  8. 8. Screen & player size: HLS.js https://github.com/dailymotion/hls.js/blob/master/src/controller/cap-level-controller.js#L68 Checks the max CapLevel corresponding to current player size Frequency: every 1000 ms
  9. 9. Dropped frames: HLS.js https://github.com/dailymotion/hls.js/blob/master/src/controller/fps-controller.js#L33 Calculates the dropped frames per second ratio. If > 0.2, bans the level forever  goes into restricted capping levels fpsDroppedMonitoringThreshold fpsDroppedMonitoringPeriod
  10. 10. Startup time strategies https://github.com/dailymotion/hls.js/blob/master/src/controller/stream-controller.js#L131 https://github.com/Dash-Industry-Forum/dash.js/blob/master/src/streaming/rules/abr/InsufficientBufferRule.js First segment loaded from the first level in the playlist (capped by the cap level rule), then continues with normal ABR rule. HLS.js DASH.js Always loads the lowest quality when buffer empty
  11. 11. II. Components: parameters 1. Bandwidth Estimation (goal: maximize bitrate) Estimate available bandwidth based on prior segment(s) Available bandwidth = size of chunk / time taken to download 2. Buffer size (goal: minimize rebuffering ratio) Rebuffering ratio = buffering time / (buffering time + playback time) Also: Abandon strategy
  12. 12. Bandwidth estimation: HLS.js quantization https://github.com/dailymotion/hls.js/blob/master/src/controller/abr-controller.js Adding levels quantization to reduce oscillation
  13. 13. (Bonus) P2P bandwidth estimation: HLS.js
  14. 14. Bandwidth estimation: DASH.JS smoothing Bandwidth smoothing, taking the last X segment estimations into account https://github.com/Dash-Industry-Forum/dash.js/blob/development/src/streaming/rules/abr/ThroughputRule.js
  15. 15. Bandwidth fragment abort rule: HLS.js and DASH.JS https://github.com/dailymotion/hls.js/blob/master/src/controller/abr-controller.js#L51 https://github.com/Dash-Industry-Forum/dash.js/blob/master/src/streaming/rules/abr/AbandonRequestsRule.js HLS.js DASH.js
  16. 16. (Bonus) DASH.JS complementary buffer-based rules Prevents from switching down when buffer is large enough (mostly for VOD) https://github.com/Dash-Industry-Forum/dash.js/blob/development/src/streaming/rules/abr/BufferOccupancyRule.js
  17. 17. Buffer size based ONLY  no more bandwidth estimations Uses utility theory to make decisions: configurable tradeoff between rebuffering potential & bitrate maximization: Maximize Vn + y Sn Where: Vn is the bitrate utility Sn is the playback Smoothness y is the tradeoff weight parameter IV. Going further: DASH.js BOLA, another approach
  18. 18. IV. Going further: test and iterate! You’ve got the power! - Know what is important to you (buffering, max bitrate, bandwidth savings…) - Compare and cross with QoS analytics to understand your audiences - Test and iterate: AB testing allows you to compare changes in real-time
  19. 19. 1. Tweak the parameters https://github.com/dailymotion/hls.js/blob/master/API .md#fine-tuning 2. Write your own rules! AbrController: AbrController capLevelController: CapLevelController, fpsController: fpsController IV. Going further: how to improve in practice HLS.js DASH.js 1. Tweak the Parameters http://cdn.dashjs.org/latest/jsdoc/index.html 2. Write your own rules https://github.com/Dash-Industry- Forum/dash.js/wiki/Migration-2.0#extending-dashjs https://github.com/Dash-Industry- Forum/dash.js/blob/development/src/streaming/rules/ abr/ABRRulesCollection.js
  20. 20. QUESTIONS?
  21. 21. Guess what? We’re Hiring! Core JavaScript ■ Backend Scalability ■ Junior Software Developer ■ Presales & Support http://www.streamroot.io/jobs
  22. 22. Further Reading / Contact Us Probe and Adapt: Rate Adaptation for HTTP Video Streaming At Scale. Zhi Li, Xiaoqing Zhu, Josh Gahm, Rong Pan, Hao Hu, Ali C. Begen, Dave Oran, Cisco Systems, 7 Jul 2013. Improving Fairness, Efficiency, and Stability in HTTP-based Adaptive Video Streaming with FESTIVE, Junchen Jiang, Carnegie Mellon University, Vyas Sekar, Stony Brook University, Hui Zhang, Carnegie Mellon, University/Conviva Inc. 2012. ELASTIC: a Client-side Controller for Dynamic Adaptive Streaming over HTTP (DASH). Luca De Cicco, Member, IEEE, Vito Caldaralo, Vittorio Palmisano, and Saverio Mascolo, Senior Member, IEEE. BOLA: Near-Optimal Bitrate Adaptation for Online Videos. Kevin Spiteri, Rahul Urgaonkar , Ramesh K. Sitaraman, University of Massachusetts Amherst, Amazon Inc., Akamai Technologies Inc. Drop us a line: Nikolay Rodionov, Co-Founder and CPO, nikolay@streamroot.io Erica Beavers, Head of Partnerships, erica@streamroot.io

×