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

Dash captions cannot handle duplicate "lang" and ignores label #645

Open
EyMaddis opened this issue Aug 27, 2019 · 6 comments

Comments

@EyMaddis
Copy link

commented Aug 27, 2019

Description

When providing multiple subtitle tracks in dash, not every track is selectable. This happens if the lang=".." attribute has the same value more than once. Only the first one is selectable

In the manifest, the <AdaptationSet mimeType="text/vtt" lang="de"> is contained twice.
Once with a label "Deutsch" and once with "forced", but only "de" will be shown, so a related issue is that Label is ignored!

This is contained twice (with different labels):

<AdaptationSet mimeType="text/vtt" lang="de">
    ....
      <Label>Forced</Label>
....
    </AdaptationSet>

Sources

Playlist that does not work:
https://universum-dev-public.s3-eu-west-1.amazonaws.com/dash_fake_caption_de_de.mpd

In case the files ever lead to 404, here is the source:

<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" type="static" minBufferTime="PT30S" profiles="urn:mpeg:dash:profile:isoff-main:2011" mediaPresentationDuration="PT3M0.224S">
  <Period start="PT0S" duration="PT3M0.224S" id="1">
    <AdaptationSet mimeType="video/mp4" frameRate="24000/1001" segmentAlignment="true" subsegmentAlignment="true" startWithSAP="1" subsegmentStartsWithSAP="1" bitstreamSwitching="false">
      <SegmentTemplate timescale="96000" media="dashvideo_1080_dash_$Number%09d$.mp4" initialization="dashvideo_1080_dashinit.mp4" duration="3603600" startNumber="1"/>
      <Representation id="1" width="1920" height="1080" bandwidth="6000000" codecs="avc1.640028"/>
    </AdaptationSet>
    <AdaptationSet mimeType="audio/mp4" lang="eng" segmentAlignment="0">
      <SegmentTemplate timescale="48000" media="dashaudio_ger_dash_$Number%09d$.mp4" initialization="dashaudio_ger_dashinit.mp4" duration="1801800" startNumber="1"/>
      <Label>DE</Label>
      <Representation id="2" bandwidth="256000" audioSamplingRate="48000" codecs="mp4a.40.2"/>
    </AdaptationSet>
    <AdaptationSet mimeType="audio/mp4" lang="eng" segmentAlignment="0">
      <SegmentTemplate timescale="48000" media="dashaudio_engl_dash_$Number%09d$.mp4" initialization="dashaudio_engl_dashinit.mp4" duration="1801800" startNumber="1"/>
      <Label>ENG</Label>
      <Representation id="3" bandwidth="96000" audioSamplingRate="48000" codecs="mp4a.40.2"/>
    </AdaptationSet>
    <AdaptationSet mimeType="text/vtt" lang="de">
      <Role schemeIdUri="urn:mpeg:dash:role" value="subtitle"/>
      <Label>Deutsch</Label>
      <Representation id="4" bandwidth="256">
        <BaseURL>dashcaption_de_dash.mpd</BaseURL>
      </Representation>
    </AdaptationSet>
    <AdaptationSet mimeType="text/vtt" lang="de">
      <Role schemeIdUri="urn:mpeg:dash:role" value="subtitle"/>
      <Label>Forced</Label>
      <Representation id="5" bandwidth="256">
        <BaseURL>dashcaption_forced_dash.mpd</BaseURL>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>

Steps to reproduce

Test case:

  1. open https://videojs.github.io/http-streaming/
  2. enter https://universum-dev-public.s3-eu-west-1.amazonaws.com/dash_fake_caption_de_de.mpd
  3. select application/dash+xml
  4. hit load (the video is not going to play, but it does not need to!)
  5. observe captions to only include de:

image

Results

Expected

Expected the text tracks list to show Deutsch and Forced instead of de once.

Additional Information

If you use
https://universum-dev-public.s3-eu-west-1.amazonaws.com/dash_fake_caption_de_en.mpd
it will separate the two tracks. All I did was to change the second lang to en instead of de!

videojs-http-streaming version

what version of videojs-http-streaming does this occur with?
videojs-http-streaming 1.10.4
( latest from example page )

videojs version

what version of videojs does this occur with?
video.js 7.5.5

Browsers

Tested in

  • Chrome 76.0.3809.100
  • Chrome Canary 78.0.3890.0
  • Firefox 67.0.4 (64-bit)

Platforms

what platforms are affected? please include operating system and version or device and version for each

  • MacOS Mojave 10.14.5 (18F132)
  • I guess all...
@welcome

This comment has been minimized.

Copy link

commented Aug 27, 2019

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@EyMaddis

This comment has been minimized.

Copy link
Author

commented Aug 27, 2019

Just a sidenote:
The dash.js reference does this correctly:
http://reference.dashif.org/dash.js/v3.0.0/samples/dash-if-reference-player/index.html

I thought that this might be a trivial usage of a Set in the parser and a missing getter for the label, but I have no idea where to actually find the parsing code to begin the investigation.

@EyMaddis EyMaddis changed the title Dash cannot handle duplicate "lang" and ignores label Dash captions cannot handle duplicate "lang" and ignores label Aug 27, 2019

@gkatsev

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

Interesting, it's possible that we deduping based on kind and language. Looking at the HTML spec now, it seems that label is also used for deduping, though, I thought that labels didn't count previously.
So, it's definitely possible we're not doing the right thing.

@EyMaddis

This comment has been minimized.

Copy link
Author

commented Aug 28, 2019

I reproduced the same problem with audio languages. Same example as above.
@gkatsev Is there a quick workaround if the files are immutable for me?

Or maybe you have a suggestion where to start when I want to investigate this myself.

@EyMaddis

This comment has been minimized.

Copy link
Author

commented Aug 29, 2019

@gkatsev I think this boils down to this line. Maybe not specifically this line, but there are probably multiple occasions where this happens. As I said, the same applies to audio tracks.

@gkatsev

This comment has been minimized.

Copy link
Member

commented Aug 29, 2019

Yeah, could be related to that piece.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.