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

Error MEDIA_ERR_DECODE after half of the video and fragmentedText not working #463

Closed SoleneChiche closed 8 years ago

SoleneChiche commented 9 years ago

Hello,

For testing purpose, I took a video, extracted its h264 and aac tracks:

MP4Box raw 1:output=video my-original-file.mp4
Extracting MPEG-4 AVC-H264 stream to h264
MP4Box raw 2:output=audio my-original-file.mp4
Extracting MPEG-4 AAC

I wrapped them in ISOBMFF containers:

MP4Box -add video.h264 video.mp4
AVC-H264 import - frame size 640 x 272 at 24.000 FPS
AVC Import results: 3581 samples - Slices: 103 I 3478 P 0 B - 0 SEI - 84 IDR
OpenGOP detected - adjusting file brand
Saving to video.mp4: 0.500 secs Interleaving

MP4Box -add audio.aac audio.mp4
AAC ADTS import  - sample rate 44100 - MPEG-4 audio - 2 channels
Saving to audio.mp4: 0.500 secs Interleaving

Then I imported an EBU-TT-D (TTML) file (3 subtitles of each 10s):

-add subtitles-ebu-tt-d.xml:ext=ttml -new captions.mp4

Then I dashed the 3 of them:

MP4Box -dash 10000-profile ondemand -frag 10000 -rap -segment-name video_segment_ video.mp4 -out manifest-video

MP4Box -dash 10000 -profile ondemand -frag 10000 -rap -segment-name audio_segment_ audio.mp4 -out manifest-audio

MP4Box -dash 10000 -profile ondemand -frag 10000 -segment-name subtitles_segment_ captions.mp4 -out manifest-subtitles

And finally I merged the 3 Adaptation Sets in one manifest (on demand profile), based on one of the 3 generated before:

<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev99-gb44dfd1-master  on 2015-03-09T09:45:51Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H2M29.21S" maxSegmentDuration="PT0H0M10.00S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
 <ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
  <Title>manifest.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period duration="PT0H2M29.21S">
  <AdaptationSet segmentAlignment="true" maxWidth="640" maxHeight="272" maxFrameRate="24" par="640:272" lang="und" subsegmentStartsWithSAP="1">
   <Representation id="1" mimeType="video/mp4" codecs="avc1.42c015" width="640" height="272" frameRate="24" sar="1:1" startWithSAP="3" bandwidth="349306">
    <BaseURL>http://localhost:8080/samples/ebu-subtitling-demo/testing_mp4box/video_segment_init.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="869-1104">
      <Initialization range="0-868"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>

  <AdaptationSet segmentAlignment="true" lang="und" subsegmentStartsWithSAP="1">
   <Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="97526">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
    <BaseURL>http://localhost:8080/samples/ebu-subtitling-demo/testing_mp4box/audio_segment_init.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="753-964">
      <Initialization range="0-752"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>

  <AdaptationSet segmentAlignment="true" lang="en" subsegmentStartsWithSAP="1">
   <Representation id="1" mimeType="video/mp4" codecs="stpp" startWithSAP="1" bandwidth="1195">
    <BaseURL>http://localhost:8080/samples/ebu-subtitling-demo/testing_mp4box/subtitles_segment_init.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="707-774">
      <Initialization range="0-706"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>

 </Period>
</MPD>

The problems now are the following:

1- No playback in Dash.js player at all when the adaptation set of subtitles is in the manifest, even if it looks like the subtitles are recognized:

Parsing complete: ( xml2json: 2ms, objectiron: 1ms, total: 0.003s) 
dash.all.js:8 Manifest has loaded. 
dash.all.js:8 Manifest has been refreshed. 
dash.all.js:8 MediaSource is open! 
dash.all.js:8 [object Event] 
dash.all.js:8 Added 0 inline events 
dash.all.js:8 video codec: video/mp4;codecs="avc1.42c015" 
dash.all.js:8 [video] stop 
dash.all.js:8 Perform SIDX load: http://localhost:8080/samples/ebu-subtitling-demo/testing_mp4box/video_segment_init.mp4 
dash.all.js:8 audio codec: audio/mp4;codecs="mp4a.40.2" 
dash.all.js:8 [audio] stop 
dash.all.js:8 Perform SIDX load: http://localhost:8080/samples/ebu-subtitling-demo/testing_mp4box/audio_segment_init.mp4 
dash.all.js:8 No text data. 
dash.all.js:8 [fragmentedText] stop 
dash.all.js:8 Perform SIDX load: http://localhost:8080/samples/ebu-subtitling-demo/testing_mp4box/subtitles_segment_init.mp4 
dash.all.js:8 Duration successfully set to: 149.21 
dash.all.js:8 Parsed SIDX box: 17 segments. 
dash.all.js:8 Parsed SIDX box: 15 segments. 
dash.all.js:8 Parsed SIDX box: 3 segments. 
dash.all.js:8 [video] start 
dash.all.js:8 [audio] start 
dash.all.js:8 [fragmentedText] start 
dash.all.js:8 loaded video:Initialization Segment:NaN (206, 0ms, 5ms) 
dash.all.js:8 [video] Initialization finished loading 
dash.all.js:8 loaded audio:Initialization Segment:NaN (206, 0ms, 5ms) 
dash.all.js:8 [audio] Initialization finished loading 
dash.all.js:8 loaded fragmentedText:Initialization Segment:NaN (206, 0ms, 7ms) 
dash.all.js:8 [fragmentedText] Initialization finished loading 
dash.all.js:8 [fragmentedText] Stalling Buffer 
dash.all.js:8 [fragmentedText] Waiting for more buffer before starting playback. 
dash.all.js:8 [video] Stalling Buffer 
dash.all.js:8 [video] Waiting for more buffer before starting playback. 
dash.all.js:8 [audio] Stalling Buffer 
dash.all.js:8 [audio] Waiting for more buffer before starting playback. 
dash.all.js:8 <video> ratechange:  0 
dash.all.js:8 <video> loadedmetadata 
dash.all.js:8 Starting playback at offset: 0 
dash.all.js:8 element loaded! 
dash.all.js:8 Start Event Controller 
dash.all.js:8 <video> play 
dash.all.js:8 [video] start 
dash.all.js:8 [video] Getting the request for time: 0 
dash.all.js:8 [video] Index for time 0 is 0 
dash.all.js:8 [video] SegmentBase: 0 / 149.21 
dash.all.js:8 [audio] start 
dash.all.js:8 [audio] Getting the request for time: 0 
dash.all.js:8 [audio] Index for time 0 is 0 
dash.all.js:8 [audio] SegmentBase: 0 / 149.21 
dash.all.js:8 [fragmentedText] start 
dash.all.js:8 [fragmentedText] Getting the request for time: 0 
dash.all.js:8 [fragmentedText] Index for time 0 is 0 
dash.all.js:8 [fragmentedText] SegmentBase: 0 / 149.21 
dash.all.js:8 loaded fragmentedText:Media Segment:0 (206, 0ms, 6ms) 
dash.all.js:8 [fragmentedText] Getting the request for time: 10 
dash.all.js:8 [fragmentedText] Index for time 10 is 0 
dash.all.js:8 [fragmentedText] SegmentBase: 0 / 149.21 
dash.all.js:8 [fragmentedText] SegmentBase: 10 / 149.21 
dash.all.js:8 [fragmentedText] Buffered Range: 0 - 0 
dash.all.js:8 [fragmentedText] Getting the request for time: 0 
dash.all.js:8 [fragmentedText] Index for time 0 is 0 
dash.all.js:8 [fragmentedText] SegmentBase: 0 / 149.21 
dash.all.js:8 loaded audio:Media Segment:0 (206, 6ms, 11ms) 
dash.all.js:8 loaded video:Media Segment:0 (206, 5ms, 13ms) 
dash.all.js:8 loaded fragmentedText:Media Segment:10 (206, 0ms, 11ms) 
dash.all.js:8 [fragmentedText] Getting the request for time: 20 
dash.all.js:8 [fragmentedText] Index for time 20 is 1 
dash.all.js:8 [fragmentedText] SegmentBase: 10 / 149.21 
dash.all.js:8 [fragmentedText] SegmentBase: 20 / 149.21 
dash.all.js:8 [fragmentedText] Buffered Range: 0 - 0 
dash.all.js:8 [fragmentedText] Buffered Range: 10 - 10 
dash.all.js:8 [audio] Getting the request for time: 9.984580498866213 
dash.all.js:8 [audio] Index for time 9.984580498866213 is 0 
dash.all.js:8 [audio] SegmentBase: 0 / 149.21 
dash.all.js:8 [audio] SegmentBase: 9.984580498866213 / 149.21 
dash.all.js:8 [audio] Got enough buffer to start. 
dash.all.js:8 [audio] Buffered Range: 0 - 9.984579 
dash.all.js:8 <video> playing 
dash.all.js:8 [video] Getting the request for time: 9.208333333333334 
dash.all.js:8 [video] Index for time 9.208333333333334 is 0 
dash.all.js:8 [video] SegmentBase: 0 / 149.21 
dash.all.js:8 [video] SegmentBase: 9.208333333333334 / 149.21 
dash.all.js:8 [video] Got enough buffer to start. 
dash.all.js:8 [video] Buffered Range: 0 - 9.208332 
dash.all.js:8 loaded audio:Media Segment:9.984580498866213 (206, 4ms, 0ms) 
dash.all.js:8 loaded video:Media Segment:9.208333333333334 (206, 4ms, 2ms) 
dash.all.js:8 loaded fragmentedText:Media Segment:20 (206, 0ms, 6ms) 
dash.all.js:8 [fragmentedText] Getting the request for time: 30 
dash.all.js:8 [fragmentedText] Index for time 30 is 2 
dash.all.js:8 [fragmentedText] SegmentBase: 20 / 149.21 
dash.all.js:8 [fragmentedText] Signal complete. 
dash.all.js:8 [fragmentedText] Stream is complete 
dash.all.js:8 [fragmentedText] Buffered Range: 0 - 0 
dash.all.js:8 [fragmentedText] Buffered Range: 10 - 10 
dash.all.js:8 [fragmentedText] Buffered Range: 20 - 20 
dash.all.js:8 [video] Getting the request for time: 18.75 
dash.all.js:8 [video] Index for time 18.75 is 1 
dash.all.js:8 [video] SegmentBase: 9.208333333333334 / 149.21 
dash.all.js:8 [video] SegmentBase: 18.75 / 149.21 
dash.all.js:8 [video] Buffered Range: 0 - 18.749999 
dash.all.js:8 loaded video:Media Segment:18.75 (206, 3ms, 1ms) 
[...]
dash.all.js:8 loaded video:Media Segment:27.583333333333332 (206, 4ms, 1ms) 
dash.all.js:8 [video] Buffered Range: 0 - 35.874999 
dash.all.js:8 [audio] Buffered Range: 0 - 39.938321  

2- When removing the subtitles adaptation set, the Dash.js player can play half of the video (1m20) and then it stops, throwing an error MEDIA_ERR_DECODE:

Video Element Error: MEDIA_ERR_DECODE 
dash.all.js:8 undefined 
dash.all.js:8 [video] stop 
dash.all.js:8 [audio] stop  

Thanks for the help.

TobbeEdgeware commented 8 years ago

Fragmented text is working since long.