Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autoLowLatencyMode config #2861

Merged
merged 8 commits into from
Nov 12, 2020

Conversation

avelad
Copy link
Member

@avelad avelad commented Sep 21, 2020

It is not always known if a stream is low latency or not (for example, when adding streams from multiple providers). To avoid having to use a responseFilter, a configuration is added to enable low latency automatically.

Related to #1525

@avelad
Copy link
Member Author

avelad commented Sep 21, 2020

@michellezhuogg This is related to your work in low latency, can you review?

@michellezhuogg
Copy link
Contributor

Hello @avelad ,

Thank you! What are the scenarios to use this config? How would it interact with lowLatencyMode config?

@avelad
Copy link
Member Author

avelad commented Sep 21, 2020

@michellezhuogg
Use a default config with:

  • lowLatencyMode = false
  • rebufferingGoal = 2
  • inaccurateManifestTolerance = 0
  • autoLowLatencyMode = true

In a Live TV app with a mix of providers and mix of low latency
Stream A (low latency), Stream B, Stream C, Stream D (low latency)

  • set default config
  • load Stream A
  • set default config
  • load Stream B
  • set default config
  • load Stream C
  • set default config
  • load Stream D

In stream A and D the player automatically chooses the low latency mode, in stream B and C the player takes the conservative values ​​of not low latency

Note: the application does not know which of the previous streams is low latency, but in the streams in which it is available it activates it by default.

@joeyparrish
Copy link
Member

@avelad, low latency mode would inhibit response filters for media segments (but not for manifests or license responses), would require the accurate manifests (inaccurateManifestTolerance=0), and would use a low startup/rebuffering goal (rebufferingGoal=0.001) to allow playback to start with less than one segment of content.

Which of these things is a problem for your scenario? If some of your content is low-latency, could you not just turn on low latency mode?

In fact, for DASH, and even for VOD, lowLatencyMode=true could result in faster startup times even without low-latency features in the manifest. So the main reason to avoid it is if you need segment response filters.

@avelad
Copy link
Member Author

avelad commented Sep 21, 2020

@joeyparrish
Speaking of LIVE streams.

The scenario is not knowing if the stream is low latency or not.

I always use inaccurateManifestTolerance = 0 by default, but using rebufferingGoal = 0.001 by default on non-low latency streams can be a problem in my case.

For VOD I have no problem.

@avelad
Copy link
Member Author

avelad commented Oct 13, 2020

Any news?

@michellezhuogg
Copy link
Contributor

Hello @avelad ,

Sorry for the late reply.

  1. Would you please help us understand better your case and the problem with using rebufferingGoal = 0.001 by default on non-low latency streams?
  2. What will enableLowLatencyMode do?
  3. What happens when:
    lowLatencyMode = true && autoLowLatencyMode = false?
    lowLatencyMode = true && autoLowLatencyMode = true?

Thank you!

@avelad
Copy link
Member Author

avelad commented Oct 14, 2020

HI @michellezhuogg,

  1. In many cases I need a rebufferingGoal = 1.5 * segmentLenght to avoid new rebuffering
  2. enableLowLatencyMode activate the lowLatencyMode flag if the stream loaded is a low latency stream.
  3. lowLatencyMode always takes precedence, so if the lowLatencyMode value is activated autoLowLatencyMode has no effect

I have been carefully studying the need for this, and the alternative is to use filters to determine if the manifest is low latency and change the rebufferingGoal setting.

Thanks,

@michellezhuogg
Copy link
Contributor

Makes sense to me, and we need better document or comments to explain how lowLatencyMode / autoLowLatencyMode work for other developers.
Thank you!

@@ -383,6 +383,13 @@ shaka.dash.DashParser = class {
}

// The segments are available earlier than the availability start time.
if (this.minTotalAvailabilityTimeOffset_ && !this.lowLatencyMode_) {
const autoLowLatencyMode = this.playerInterface_.isAutoLowLatencyMode();
if (autoLowLatencyMode) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comments here to explain how lowLatencyMode & autoLowLatencyMode works.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

* lowLatencyMode is set to true, inaccurateManifestTolerance is set to 0
* unless specified, and rebufferingGoal to 0.01 unless specified at the same
* time.
* @property {boolean} autoLowLatencyMode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add more comment here to clarify how autoLowLatencyMode interacts with lowLatencyMode.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

lib/dash/dash_parser.js Outdated Show resolved Hide resolved
@shaka-bot
Copy link
Collaborator

All tests passed!

@avelad
Copy link
Member Author

avelad commented Nov 6, 2020

@michellezhuogg Is there anything else I can do so this PR can be merged?

@michellezhuogg michellezhuogg merged commit 28f35c2 into shaka-project:master Nov 12, 2020
@avelad avelad deleted the auto-low-latency branch November 13, 2020 06:58
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants