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

split ThroughputHistory out of ThroughputRule, update InsufficientBufferRule #2003

Merged
merged 9 commits into from
Jun 16, 2017

Conversation

spiterikevin
Copy link
Contributor

Move the throughput/latency estimation from ThroughputRule to a separate ThroughputHistory.
Update the InsufficientBufferRule to also avoid downloading bitrates that are more prone to lead to rebuffering.

Copy link
Contributor

@dsparacio dsparacio left a comment

Choose a reason for hiding this comment

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

LGTM

@dsparacio
Copy link
Contributor

@robertbryer @bbcrddave Kevin is looking for outside reviewers for the ABR PR.

Copy link
Contributor

@davemevans davemevans left a comment

Choose a reason for hiding this comment

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

It LGTM but @robertbryer is our ABR expert, so it'd be worth him looking.


arr = arr.slice(-sampleSize); // still works if sampleSize too large
// arr.length >= 1
return arr.reduce((av, elem, i) => av + (elem - av) / (i + 1));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer arr.reduce((av, elem) => av + elem) / arr.length - more intelligible and only one divide is done.

let throughput = throughputHistory.getAverageThroughput(mediaType);
let latency = throughputHistory.getAverageLatency(mediaType);

let bitrate = throughput * (bufferLevel / fragmentDuration) * INSUFFICIENT_BUFFER_SAFETY_FACTOR;
Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming this rule will be triggered immediately after an append to buffer (likely, at these buffer levels), (bufferLevel/fragmentDuration) will be a minimum of 1, so the throughput can only ever be halved at most - Was a more radical bitrate change wanted?

In the same vein, does this still work for MPDs where fragment duration is not constant?

Copy link
Contributor Author

@spiterikevin spiterikevin Jun 15, 2017

Choose a reason for hiding this comment

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

... the throughput can only ever be halved at most - Was a more radical bitrate change wanted?

I thought 0.5 should be conservative enough, but it's just an arbitrary value which I wouldn't mind changing.

In the same vein, does this still work for MPDs where fragment duration is not constant?

I don't think fragment duration varies too much. This still works fine with small (<10%) variation in fragment size. Did you have a particular example in mind with larger variation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants