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

limitBitrateByPortal option misbehaves for unsorted Representation mpd files #3955

Closed
5 tasks done
francox9 opened this issue Jun 8, 2022 · 4 comments
Closed
5 tasks done
Assignees
Labels
Milestone

Comments

@francox9
Copy link

francox9 commented Jun 8, 2022

Environment
  • Link to playable MPD file: unrelated
  • Dash.js version: 4.1.0 (4.4.0 failed too)
  • Browser name/version: unrelated
  • OS name/version: unrelated
Steps to reproduce
  1. Use a mpd file with unsorted (in terms of bandwidth / width) Representation, sample:
<Representation id="1" width="852" height="480" frameRate="25/1" bandwidth="1196651" codecs="avc1.64001E">
</Representation>
<Representation id="2" width="1920" height="1080" frameRate="25/1" bandwidth="5354565" codecs="avc1.640028">
</Representation>
<Representation id="3" width="1280" height="720" frameRate="25/1" bandwidth="2629619" codecs="avc1.64001F">
</Representation>
<Representation id="4" width="960" height="540" frameRate="25/1" bandwidth="1414873" codecs="avc1.64001F">
</Representation>
<Representation id="5" width="640" height="360" frameRate="25/1" bandwidth="600000" codecs="avc1.4D401E">
</Representation>
  1. Enable streaming.abr.limitBitrateByPortal option
Observed behavior

Resize window and notice abr is not functioning as expected - the minimum bandwidth that has a width larger than current portal size

It seems the reason behind is in AbrController, _checkPortalSize just assumes representation is a sorted array (source) based on bandwith/width from smaller to larger. However representation can be unsorted - it comes from adapter.getAdaptationForType(streamInfo.index, type, streamInfo).Representation (source).

Dash'll need to use adapter.getAdaptationForType(streamInfo.index, type, streamInfo).Representation_asArray instead. And this change solves the issue for me in my local testing.

The other occurrence of the Representation will probably need the same change (source)

Console output
Paste the contents of the browser console here.
You may need to enable debug logging in dash.js by calling player.updateSettings({ 'debug': { 'logLevel': dashjs.Debug.LOG_LEVEL_DEBUG }}) if you are using your own page.

Unrelated

Expected behavior

limitBitrateByPortal should behave correctly for mpd with unsorted Representations

@francox9 francox9 added the Bug label Jun 8, 2022
@francox9
Copy link
Author

francox9 commented Jun 8, 2022

I'll be happy to add in some testing & make out of it a PR if confirmed a proper fix.

@dsilhavy
Copy link
Collaborator

@francox9 Thank you for sharing this observation. I implemented the solution you proposed here: #3970 . Can you confirm that this fixes the issue?

@dsilhavy dsilhavy self-assigned this Jun 27, 2022
@dsilhavy
Copy link
Collaborator

dsilhavy commented Jul 6, 2022

Fixed in #3970

@dsilhavy dsilhavy closed this as completed Jul 6, 2022
@francox9
Copy link
Author

francox9 commented Jul 6, 2022

@francox9 Thank you for sharing this observation. I implemented the solution you proposed here: #3970 . Can you confirm that this fixes the issue?

thank you!

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

No branches or pull requests

2 participants