Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.09k stars 1.67k forks source link

Only one caption shown with multiple webVTT of same language #3915

Closed Eeel-12 closed 1 year ago

Eeel-12 commented 2 years ago
Environment
Steps to reproduce

Command used to create files:

MP4Box -add test_5_text.srt:FMT=VTT:lang=fr test.mp4
MP4Box -add test_5_text.srt:FMT=VTT:lang=fr test.mp4
MP4Box -dash 10000 -profile dashavc264:onDemand test.mp4#trackID=1:id=video test.mp4#trackID=2:id=fre test.mp4#trackID=3:id=eng test.mp4#trackID=6:id=fr_forced test.mp4#trackID=7:id=fr_full -out test.mpd
Observed behavior

Text caption: Player control bar only show one subtitle track, the forced one. Video and audios work fine, audio tracks can be selected from control bar player.

Expected behavior

Display all subtitles in adpatation of the same lang in the caption menu.

Help appreciated.

dsilhavy commented 2 years ago

Can you share a hosted version of the MPD and the segments please?

Eeel-12 commented 2 years ago

Hello @dsilhavy,

i think i figured out today, the two subtitles now loads properly. I did not put the role attribute to tracks, from the man page

:role=VALUE: set the role of this representation (cf DASH spec). Media with different roles belong to different adaptation sets.

now that the two subtitles in same language are in different adaptation set, dash.js show the two tracks.

MP4Box command line:

MP4Box -dash 10000 -profile dashavc264:onDemand test.mp4#trackID=1:id=video test.mp4#trackID=2:id=fre test.mp4#trackID=3:id=eng test.mp4#trackID=6:id=fr_forced:role=forced-subtitle test.mp4#trackID=7:id=fr_full:role=subtitle -out test.mpd

resulting mpd file:

<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 2.0-revrelease at 2022-04-07T20:06:35.600Z -->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT1H49M49.589S" maxSubsegmentDuration="PT0H0M19.562S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011,http://dashif.org/guidelines/dash264">
 <ProgramInformation moreInformationURL="http://gpac.io">
  <Title>test.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period duration="PT1H49M49.589S">
  <AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="24000/1001" par="16:9" lang="und" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
   <Representation id="video" mimeType="video/mp4" codecs="avc1.64001F" width="1280" height="720" frameRate="24000/1001" sar="27:26" bandwidth="2438428">
    <BaseURL>test_dash_track1_init.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="1787-9726">
     <Initialization range="0-990"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" lang="fra" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
   <Representation id="fre" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" bandwidth="160690">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
    <BaseURL>test_dash_track2_init.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="1766-9705">
     <Initialization range="0-969"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" lang="eng" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
   <Representation id="eng" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" bandwidth="160751">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
    <BaseURL>test_dash_track3_init.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="1766-9705">
     <Initialization range="0-969"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" lang="fra" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
   <Role schemeIdUri="urn:mpeg:dash:role:2011" value="forced-subtitle"/>
   <Representation id="fr_forced" mimeType="application/mp4" codecs="wvtt" bandwidth="25">
    <BaseURL>test_dash_track6_init.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="960-8899">
     <Initialization range="0-799"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" lang="fra" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
   <Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle"/>
   <Representation id="fr_full" mimeType="application/mp4" codecs="wvtt" bandwidth="125">
    <BaseURL>test_dash_track7_init.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="1596-9535">
     <Initialization range="0-799"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>

I'm still testing and playing around with MP4Box and various type of codec for subtitles looking for the best result, any advices on my MP4Box command line arguments are welcome. Also not shure that subtitles are perfectly synced when jumping randomly to various timestamp have to investigate this.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. However, it might still be relevant so please leave a short comment if it should remain open. Otherwise the issue will be closed automatically after two weeks. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically closed because no further activity occurred. If you think this issue is still relevant please reopen it or contact @dsilhavy. Thank you for your contributions.