-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conditionally abort requests when downgrading #1051
Comments
Shaka Player, for simplicity, does not have a way to abandon in-flight requests when switching resolutions. Our bandwidth estimate is also based on the time to download full segments, so AbrManager may not recognize the need to switch until after a request has completed very slowly. To improve that, we would need to:
As a side note, presentation delay has no bearing on the buffering goal. In your scenario, you would buffer ahead a minimum of 10 seconds. If the number falls to 9.9999..., we would fetch another segment. Given the 10-second segment size, at any given time, you may have up to 20 seconds buffered. |
Renamed and scheduled for v2.4 as an enhancement. Thanks for filing! |
" In your scenario, you would buffer ahead a minimum of 10 seconds. If the number falls to 9.9999..., we would fetch another segment. " Anyway i dont get what buffergoal is doing in our case? We attempted to change it to 100, but still no change, bufferered about 30 seconds ahead, it seems to that in live content some other rule persist. |
No, I mean if the amount of media buffered ahead of video.currentTime is less than 10, we fetch another segment. The effect of presentation delay is to say that "this amount of content exists on the server, but don't show it to the user yet." So a delay of 20 means there are 20 seconds of content past the user-visible "live edge" that could be buffered ahead of time. This is why you can't buffer more than 30 seconds ahead, no matter how large your buffering goal is. Content beyond that in the live stream isn't available to the client yet. |
So buffer ahead is only configurable via suggested presentation delay, right? Negative side of it - is that we go far from live, as i understand. So i still dont get why presentation delay is 20 sec, but we can buffer up to 30 seconds, is it related to your words about 9.9999? |
Correct. In a live stream, you can't buffer ahead at the edge more than 1 segment + presentation delay, because nothing else is available. I'd have to analyze your content to see why you are getting 30 seconds. If that is concerning, please open a separate issue for that. I'd like to leave this one focused on the enhancement in #1051 (comment) about aborting requests when switching resolutions. Thanks! |
Things to do:
|
This is part 1 of conditionally aborting requests when network downgrading. 1. Add progress event handler for Http XHR Plugin, to get more frequent updates for network bandwidth estimate and suggest streams based on that. 2. When the plugin doesn't support progress event, call onProgressUpdated function after every segment is downloaded. 3. Replace onSegmentDownloaded with onProgressUpdated function in player.js and network_engine.js. 4. Since XHR Plugin supports progress event while Fetch doesn't, change the config to prefer XHR over Fetch API. Issue #1051. Change-Id: Icf6775dd3520fb2e359b13d29e3b39d3792fe865
First part of the implementation landed. Quoting @TheModMaker from an internal review, we still need to add tests to verify that:
|
When the network becomes slow, we check if stopping the current request and download the content with lower resolution is faster. If so, abort the current request and start a new one. Issue #1051 Change-Id: I588e524469432e362361d1cfbde6cd45c2009959
Have you read the FAQ and checked for duplicate issues: yes
What version of Shaka Player are you using: latest master
Can you reproduce the issue with our latest release version: yes
Can you reproduce the issue with the latest code from
master
: yesAre you using the demo app or your own custom app: custom
If custom app, can you reproduce the issue using our demo app: hard to me to check it on demo
What browser and OS are you using:chrome
What are the manifest and license server URIs: sent to gmail
(you can send the URIs to [email protected] instead, but please use GitHub and the template for the rest)
**What did you do?**Opened stream, watched highest bitrate, then in chrome console made network 450 kbit/s
What did you expect to happen? Player should turn to SD content and not to stall
What actually happened? Player attempted to download the highest bitrate fragment, it was very slow, up to 15-20 seconds. In our confiuration (fragments=10seconds, suggestet presentation delay is 20, minbuffertime=10, buffering goal=10, rebufferinggoal=2). When we watch live content, with this configuration we have 30 seconds buffer ahead (am i correctly undestand that it equal "suggestet presentation delay" + "buffering goal"?). If i fall bandwith to 450kbit here is what happens:
-player have 30 seconds of buffer ahead
-10 secodns passed and player attempts to download new segment (20 seconds of buffer left)
-ABR did not get that speed is very slow and still try to download highets bitrate fragment, so it takes more then 10 seconds
-At tenth second of downloading fragment there is in buffer left 10 seconds of playable content and it reached minbuffertime=10, so player stalls in buffering, as i remember only next frament is downloaded as SD.
Is there any way to improve ABR? Maybe it is necessary to look how in DASHif its made (at least they have abandon rule and i also described how to imrpove their rule Dash-Industry-Forum/dash.js#1382)
P.s. In FAQ https://github.com/google/shaka-player/blob/master/docs/tutorials/faq.md there is mention about "Why does it take so long to switch to HD?", defaultBandwidthEstimate is 500kbit in our case, but in this case it does not help anyway, because player have enough info about bandwith.
The text was updated successfully, but these errors were encountered: