Skip to content

Document ABR and Streaming Behavior #629

Closed
@robwalch

Description

@robwalch

I'm looking for answers to these questions to better understand playback start time and adaptive bitrate switching in shaka. I've made a few assumptions from the configuration docs. Can you confirm these and provide some answers to the unknowns?

  1. How much is buffered before playback starts (minimum time or size buffered)?
    Answer: Approximately 2-30 seconds; between the streaming rebufferingGoal* and bufferingGoal.
    *A DASH manifest's minBufferTime, if greater, overrides rebufferingGoal
  2. What conditions trigger an adaptive up or down switch?
    Answer: (logic is the same for up and down)
    1. Bandwidth estimator has a good estimate (at least 128kB of media has been loaded - https://github.com/google/shaka-player/blob/master/lib/abr/ewma_bandwidth_estimator.js#L69)
    2. At least 8 seconds has past since the last switch (or playback start?)
    3. Another video quality's min and max bitrate requirements better match the current estimate.
      Note: in the case of multiple audio qualities, the middle quality is always selected.
  3. How far ahead of the current playhead are new qualities requested and appended?
    Don't know. How much previously buffered media replaced - as much or as little as possible?
  4. Can an adaptive bitrate/quality change occur before playback begins?
    Don't know. Revise answers to last two questions.
  5. What changes in v2.0.1 where made to improve playback start and ABR performance?
    Answer: Bandwidth estimator sampling rate increased... (need more specifics on timing and bytes evaluated)
  6. What configuration options can be used to modify ABR behavior?
    Answer: These are the defaults
 abr: {
   defaultBandwidthEstimate: 500000,
   enabled: true, // True when "Auto" level is selected in JW Player
   manager: SimpleAbrManager,
 },
 streaming: {
   bufferBehind: 30,
   bufferingGoal: 30, // Changed to 10 in v2.0.1
   ignoreTextStreamFailures: false,
   rebufferingGoal: 2,
   retryParameters: {
     maxAttempts: 2,
     baseDelay: 1E3,
     backoffFactor: 2,
     fuzzFactor: .5,
     timeout: 0,
   }
 }

See:
http://shaka-player-demo.appspot.com/docs/api/tutorial-config.html
http://shaka-player-demo.appspot.com/docs/api/shakaExtern.html#AbrConfiguration

defaultBandwidthEstimate number The default bandwidth estimate to use if there is not enough data, in bit/sec.

http://shaka-player-demo.appspot.com/docs/api/tutorial-network-and-buffering-config.html

bufferingGoal is the amount of content we try to buffer. For example, if this is set to 30, we fetch segments until we have at least 30 seconds buffered.

rebufferingGoal is the amount of content we have to have buffered before we can play. For example, if this is 15, we stay in a buffering state until we have at least 15 seconds buffered. This affects both buffering at startup and rebuffering later during playback.

NOTE: A DASH manifest's minBufferTime, if greater, overrides rebufferingGoal.

http://shaka-player-demo.appspot.com/docs/api/lib_abr_simple_abr_manager.js.html#line69

SimpleAbrManager.SWITCH_INTERVAL_MS = 8000
The minimum amount of time that must pass between switches, in milliseconds.
This keeps us from changing too often and annoying the user.

SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_ = 0.85
The fraction of the estimated bandwidth which we should try to use when upgrading.

SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_ = 0.95
The largest fraction of the estimated bandwidth we should use. We should downgrade to avoid this.

Thank you!

Metadata

Metadata

Assignees

Labels

status: archivedArchived and locked; will not be updatedtype: docsImprovements or fixes to documentationtype: enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions