Prefer a codec continuity if possible#1839
Conversation
80fdc55 to
90546cf
Compare
|
I looked at the spec to understand if there's an explicit order for the A/V track choice, especially where Turns out that DASH-IF IOP 5.0 has a dedicated chapter on initial selection for audio tracks in: (chapter So basically from what I understand, in order:
So it depends on the intended "spirit" of step 3, and if DASH' They probably did not think of that case when writing this. |
Current track choice behavior ----------------------------- The track-choice API of the RxPlayer was until now very simple in terms of behavior: - Either the application gives an explicit choice, usually by listening to the `newAvailablePeriods` event (whose first purpose is to indicate that new tracks/qualities choices can be made) and by calling API like `setAudioTrack` in this handler. - Either it doesn't do that and the RxPlayer just defines an order purely based on the content. The content itself can indicate priorities explicitly (e.g. the `selectionPriority` attributes), implicitly (`AdaptatationSet` with `role` set to `"main"`) or a third case that I would call "very implicitly": just the order in which they are defined in the Manifest. That's the sole rules the RxPlayer used for initial track selection, in order of importance (from the most to the least). Issue ----- We encountered cases where some multi-Periods Manifest do not indicate a preferred track priority and the application select none. In that case I written earlier we just rely on declaration order in the Manifest (first declared is preferred). However, thoses Manifest were not regular in that order, for some Periods in their case you would have AAC, then ec-3 declared, and for other Periods in the same content you would have the reverse. This led to probably unwanted codec switching, even leading to many case to "reloading" phases, where the screen would switch to black and rebuffer temporarily. My solution ----------- I propose here a very simple solution both in terms of logic and conceptually: if a track choice has already been made in that content, **and** if the application did not choose a track for that Period, just stay consistent with the last chosen track of the same type in terms of codec: if we last chose `ec-3` we continue with `ec-3`. There is however a big question and risk with this feature, it is that it supersedes even explicit Manifest hints like DASH' `AdaptationSet@selectionPriority`. I'm not sure 100% is what we want here. I'll have to check the spec and see how other players decide before being sure this is the right way.
90546cf to
46ed882
Compare
|
✅ Automated performance checks have passed on commit DetailsPerformance tests 1st run outputNo significative change in performance for tests:
|
Current track choice behavior
The track-choice API of the RxPlayer was until now very simple in terms of behavior:
Either the application gives an explicit choice, usually by listening to the
newAvailablePeriodsevent (whose first purpose is to indicate that new tracks/qualities choices can be made) and by calling API likesetAudioTrackin this handler.Either it doesn't do that and the RxPlayer just defines an order purely based on the content.
The content itself can indicate priorities explicitly (e.g. the
selectionPriorityattributes), implicitly (AdaptatationSetwithroleset to"main") or a third case that I would call "very implicitly": just the order in which they are defined in the Manifest.That's the sole rules the RxPlayer used for initial track selection, in order of importance (from the most to the least).
Issue
We encountered cases where some multi-Periods Manifest do not indicate a preferred track priority and the application select none. In that case as I wrote earlier we just rely on declaration order in the Manifest (first declared is preferred).
However, those Manifests were not regular in that order, for some Periods in their case you would have AAC, then ec-3 declared, and for other Periods in the same content you would have the reverse.
This led to probably unwanted codec switching, even leading to many case to "reloading" phases, where the screen would switch to black and rebuffer temporarily.
My solution
I propose here a very simple solution both in terms of logic and conceptually: if a track choice has already been made in that content, and if the application did not choose a track for that Period, just stay consistent with the last chosen track (of the current playback session) of the same type in terms of codec: if we last chose
ec-3we continue withec-3.There is however a big question and risk with this feature, it is that it supersedes even explicit Manifest hints like DASH'
AdaptationSet@selectionPriority.I'm not sure 100% is what we want here. I'll have to check the spec and see how other players decide before being sure this is the right way.