inputstream.adaptive
inputstream.adaptive copied to clipboard
AdaptationSet default flag regression
Previously used 2.3.x version and when I got:
<AdaptationSet audioTrackId="en-us_dialog_0" contentType="audio" group="1" default="true" lang="en" maxBandwidth="192000" mimeType="audio/mp4" minBandwidth="96000" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
then it was correctly marked as default
in Kodi 18.
And when I skipped default="true"
- it was no longer marked as default
audio track.
With 2.4.4 regardless if I provide default="true" or not, all tracks are marked as default
ones.
Found that 2.4.2 works fine, issue appears in 2.4.3+.
https://github.com/peak3d/inputstream.adaptive/commit/4bd162e35c541ed65c22c3ab7ba987ab6fd7fe80#diff-fc4abc2b8c72e480ba9689e8d056c8efR606
This line specifically caused regression. Amazon VOD outputs multiple audio AdaptationSets with Role=main and this causes them all to be marked as default.
As a workaround I had to do change Role value for audio streams:
data = data.replace('<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>', '<Role schemeIdUri="urn:mpeg:dash:role:2011" value="whatever"/>')
But I don't believe that it should mark default_ for Role=main, at least not for audio streams. @CastagnaIT as you were the author of this change, what do you think?
this is not a regression it's the use you make that's wrong
if you read a few lines above it is explained that using the Role to set the default stream is a Legacy method
as some old MPD documentation explains, the "main" should only be set on the stream to be defined by default, not in to all streams
I do not recommend using the Role to set "default" property, using the Role does not allow you to set several different properties on the same stream (eg. default, forced at same time as Kodi require)
instead you have to set all this properties (default, impaired, original) to the AdaptationSet: eg:
...<AdaptationSet contentType="audio" default="true" impaired="false" original="true" lang="en" mimeType="audio/mp4"><Representation ....
You can see how is implemented in nf: https://github.com/CastagnaIT/plugin.video.netflix/blob/master/resources/lib/services/msl/converter.py#L179
@CastagnaIT thing is, as I noted above, Amazon VOD already outputs multiple Role=main by itself, not my code. So right now I would have to filter those Roles out. Or otherwise, even when setting default="false" impaired="false" original="false"
you end up with default=true (as it gets overridden by Role inside AdaptionSet). Which wasn't the case in 2.4.2, hence regression.
Ideally, it should only override if default wasn't explicitly set before.
Or, it should at very least only override for: type_ == DASHTree::SUBTITLE
like it did before. Now it does override for all types.
A change can be a fix for one use-case, and is a regression for another. So those are not mutually exclusive :wink:
Yes or you use the Rule or adaptionset prop not mixing both, depend what you need
I still don't understand, why exactly was it changed though that it overrides default flag for non-subtitle streams?
Your PR was meant to "fix and improve subtitle properties" and yet it changed the way non-subtitle streams are processed. Legacy Role mode was ONLY used for subtitles. This shouldn't be a subject of change in a minor version bump.
@23doors pls provide a full mpd file here, thx
@23doors thanks for closing PR - is the issue itself still valid?
I have reviewed the situation, and these are my conclusions
Seems there are no restriction of any kind to Role
in DASH specs
you can see a summary also here: https://www.brendanlong.com/common-informative-metadata-in-mpeg-dash.html
all tracks can be set also as default,
only the old DASH specs that i am not able to find anymore, said that Role "main" should be set only to a single track, thing not specified on last DASH specs, probably because each video service can handles it as it wishes.
The only thing specified is that if Role
field is missing the track must be considered as "main" so as default.
This also means that all the times that a MPD not have "Role" fields all tracks will be set as default.
Currently ISA do the things in right way, so tracks with Role set as "main" will be sets as default, with the exception that if "Role" field does not exist ISA not set as default all the tracks.
Kodi "default" flag has a custom meaning which may not always correspond to a DASH manifest.
On Kodi "default" track property is used to give precedence to an track, but depends on kodi settings, and what an addon want to do:
Case 1) when a language is set in kodi language settings, this prop. is used to give the precedence only when there are two same tracks with same language but that can have different properties like differents channels / codecs (for audio need setting Prefer audio default streams
)
Case 2) when mediadefault is set in kodi language settings, then this will select the track set as default (should be only one, for example with N€tfix addon if this setting is set, i set as default streams with language that match the user N€tfx profile used)
Example for the use case 1:
- Audio track eng 5.1
- Audio track eng 2.0 If here we do not set the default track kodi select what it finds depending on how they are listed (so the 5.1), instead if we set as "default" the preferred track:
- Audio track eng 5.1
- Audio track eng 2.0 - default we can assure that the track 2.0 will be selected instead of the first one.
I have no idea why am@zon would set all streams as "main", the VOD service will have their reasons
But in any case if we have all tracks set as default this could be a problem depending also from Kodi settings used
For the use case 1: if all streams are set as defaults in general there are no problems, the user will have to switch tracks if he wants a stream with different channels/codec
For the use case 2: if all streams are set as defaults this is a problem, kodi track selection no longer makes sense
i think we can think to implement a kind of workaround for the case 2: add another ListItem ISA property something like what we already have "inputstream.adaptive.original_audio_language". Maybe "inputstream.adaptive.audio_default_language", "inputstream.adaptive.subtitles_default_language", where an addon can override the "default" flags, it won't be perfect, but it will make things easier for those who don't want to implement a proxy to parse and edit the MPD manifest on the fly
this is a new feature that not concern this Issue at the end i suggest to close this Issue
maybe the only improvement that can be done is find a way to allow to the ISA custom tags in AdaptationSet
(like "default") to override the "Role" field content