-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Improve default live quality increase settings to work with live streams playing at ~3 segments live offset. #9784
Comments
The short answer is that there is not enough buffered data to safely switch up to a higher quality. The manifest is configured with a suggested presentation delay of 9.6 seconds, which is exactly 3 segments (as one segment duration is 3.2 seconds). So at the point where the player needs to select a newly available segment, it has at most 6.4 seconds (=2 segments) of media buffered. The actual value I observed with my network was between 5 and 6 seconds. The
The buffered duration needs to be more than one of these two values for the player to switch up to a higher quality. This never happens (as it is between 5 and 6 seconds), and so the player stays at the lower quality although the bandwidth measurements support switching up. If you change the setting of either value it'll work (for example The issue has come up multiple times now for live streams that have a reasonable configuration of playing about 3 segments away from the live edge (e.g. #9643). A live offset of 3 segments is also recommended by default for HLS. So we should ensure our default configuration allows such streams to increase the quality under good conditions. There are two options to implement this:
|
Thanks a lot for your detailed answer! |
We check the fraction of the available duration we have already buffered for live streams to see if we can increase the quality. This fraction compares against the overall available media duration at the time of the track selection, which by definition can't include one of the availabe chunks (as this is the one we want to load next). That means, for example, that for a reasonable live offset of 3 segments we can at most reach a fraction of 0.66, which is less than our default threshold of 0.75, meaning we can never switch up. By subtracting one chunk duration from the available duration, we make this comparison fair again and allow all live streams (regardless of live offset) to reach up to 100% buffered data (which is above our default value of 75%), so that they can increase the quality. Issue: #9784 PiperOrigin-RevId: 416791033
We check the fraction of the available duration we have already buffered for live streams to see if we can increase the quality. This fraction compares against the overall available media duration at the time of the track selection, which by definition can't include one of the availabe chunks (as this is the one we want to load next). That means, for example, that for a reasonable live offset of 3 segments we can at most reach a fraction of 0.66, which is less than our default threshold of 0.75, meaning we can never switch up. By subtracting one chunk duration from the available duration, we make this comparison fair again and allow all live streams (regardless of live offset) to reach up to 100% buffered data (which is above our default value of 75%), so that they can increase the quality. Issue: google/ExoPlayer#9784 PiperOrigin-RevId: 416791033
Implemented by the commit above. |
Hi @tonihei , I encountered same issue and tested the above fix commit. It improves the behaviour but I can still reproduce this for some cases where I have 4 seconds segments and 4 seconds as MPD update period. Below is my observation. Each MPD update contains 4 segments with a new segment added and oldest segment removed every MPD update(4 seconds).
|
Hi @tonihei with the above insight provided against this issue still being present for 4 Second segments with a 4 second update period can I ask would you be able to reopen this ticket to handle this permutation also? Can I also ask in the interim of this issue not being merged and the above 4sec segment issue observed what would recommend for segment update and segment length to not encounter this issue? Do you see an issue with 2Sec segments with a 4second update for example. |
What you describe above is exactly the problem we solved I believe.
In this scenario, we have If this doesn't happen, then the measured bandwidth is potentially not high enough for the up-switch? If that's not what you are seeing, please provide a concrete example for values used during the computation or reproduction steps with a specific stream.
The new logic works independent of the actual chunk duration, so there is no need to solve it for any particular permutation. But it generally assumes that the MPD update period is the same as the chunk duration to work nicely, so it wouldn't work as well with 2 sec segment and a 4 sec update period. |
thanks @tonihei for your reply.
Above does not happen as
|
I see, thanks for pointing this out! This edge case only applies if |
We have two ways to choose the minDurationForQualityIncreaseMs value in AdaptiveTrackSelection: use the configured value for non-live or when enough buffered data is available, or use a fraction of the available duration to allow switching when playing close to the live edge. The decision point when to use which value isn't quite consistent because we compare against availableDurationUs before making the adjustments. This means there is range of values where no up-switching is possible despite perfect buffering. Fix this by choosing the minimum of both values. Issue: google/ExoPlayer#9784 #minor-release PiperOrigin-RevId: 428474332
We have two ways to choose the minDurationForQualityIncreaseMs value in AdaptiveTrackSelection: use the configured value for non-live or when enough buffered data is available, or use a fraction of the available duration to allow switching when playing close to the live edge. The decision point when to use which value isn't quite consistent because we compare against availableDurationUs before making the adjustments. This means there is range of values where no up-switching is possible despite perfect buffering. Fix this by choosing the minimum of both values. Issue: #9784 #minor-release PiperOrigin-RevId: 428474332
We have two ways to choose the minDurationForQualityIncreaseMs value in AdaptiveTrackSelection: use the configured value for non-live or when enough buffered data is available, or use a fraction of the available duration to allow switching when playing close to the live edge. The decision point when to use which value isn't quite consistent because we compare against availableDurationUs before making the adjustments. This means there is range of values where no up-switching is possible despite perfect buffering. Fix this by choosing the minimum of both values. Issue: #9784 #minor-release PiperOrigin-RevId: 428474332
We have two ways to choose the minDurationForQualityIncreaseMs value in AdaptiveTrackSelection: use the configured value for non-live or when enough buffered data is available, or use a fraction of the available duration to allow switching when playing close to the live edge. The decision point when to use which value isn't quite consistent because we compare against availableDurationUs before making the adjustments. This means there is range of values where no up-switching is possible despite perfect buffering. Fix this by choosing the minimum of both values. Issue: google/ExoPlayer#9784 #minor-release PiperOrigin-RevId: 428474332
I'm reproducing an issue with all versions of ExoPlayer from 2.13.0 to 2.16.1 where ExoPlayer does not switch to a higher resolution on a Live DASH stream with AVC video tracks.
ExoPlayer starts playing the 896x504 track then never chooses 1280x720 or 1920x1080 even if there is enough network bandwidth.
Here is the list of available video tracks:
As stream URL and DRM info are sensitive, I'll provide you by email a sample code hosted on a private GitHub repository to help you reproduce the issue. Please let me know if you need anything else.
The text was updated successfully, but these errors were encountered: