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

Abandon rule threshold #1382

Closed
kuznetcoff777 opened this issue May 6, 2016 · 3 comments
Closed

Abandon rule threshold #1382

kuznetcoff777 opened this issue May 6, 2016 · 3 comments

Comments

@kuznetcoff777
Copy link

Hello. Few questions about this rule and proposal for improvement of efficiency:
-how often does check (in that rule) happens?
-if this situation possible: segment is downloading (90% completed) speed of downloading is going down dramatically (for a few seconds) and abandon check happens, it counts low speed and counts fragmentInfo.estimatedTimeOfDownload too long, so abandon rule aborts downloading and asks to switch down. So maybe it is need to consider the percentage of already downloaded file and to make configurable this percentage. For example make this variable by default = 80% and if segment is downloaded for 81% not to abort downloading?

@dsparacio
Copy link
Contributor

@kuznetcoff777 You bring up a very good point and we Identified that last year when I implemented this. This was the basic version and that check does need to happen. I am actually working on something like this to check for position within fragment for something else, but I bet we can reuse the logic for both cases. Ill keep that in mind when writing it and keep this open to track the feature enhancement.

@kuznetcoff777
Copy link
Author

kuznetcoff777 commented May 12, 2016

abandon-git.xlsx
I just made simple excel document where emulated download of 1MB file and how abandon rule should act if 90% of file already downloaded and speed dramatically going down. For simplicity check goes every second and you can change parameter fragmentInfo.bytesLoaded. All other are constants (fragmentInfo.segmentDuration, ABANDON_MULTIPLIER, fragmentInfo.bytesTotal, fragmentInfo.elapsedTime) and other (fragmentInfo.measuredBandwidthInKbps fragmentInfo.estimatedTimeOfDownload) is maths from that numbers. So in this situation on a 9-10 second speed goes from 100KB/s to 10kB/s. So if speed stays the same 10kB/s for 5 seconds more abandon rule should make abort for download. So if rule acts as i described in this file, i think it is very satisfactorily. Or maybe it is necessary to look at RICH_BUFFER_THRESHOLD, if we have it more then this value, then maybe we should continue to download segment even on a such low speed.

@dsparacio dsparacio self-assigned this Sep 8, 2016
@dsparacio
Copy link
Contributor

Going to close this was actually implemented in the last release v2.3 with

const estimateOtherBytesTotal = fragmentInfo.bytesTotal * bitrateList[newQuality].bitrate / bitrateList[abrController.getQualityFor(mediaType, mediaInfo.streamInfo)].bitrate;

                if (bytesRemaining > estimateOtherBytesTotal) {

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

No branches or pull requests

2 participants