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.12k stars 1.68k forks source link

Regression: Stall on partially loaded next period after an intra-period seek #4162

Closed alexhmit closed 1 year ago

alexhmit commented 1 year ago
Environment
Steps to reproduce
  1. Play from the beginning. Wait for the buffering beyond first period, i.e. 2nd period buffering started. This problem needs to have fast segment download so the 1st period is fully loaded well ahead of the playback. This is an important precondition and maybe tricky to trigger depending on the network condition.
  2. Seek to sometime before the end of 1st period. In our case, 58 seconds mark.
  3. Wait for the playback into 2nd period. The playback will stall.
  4. 100% reproducible. This problem does not occur with version older than 4.5.2.
Observed behavior

The playback stalled because it is no longer fetching segments. This seems to be caused by canceling preload during the seek which canceled the 2nd period preload in progress but the loading of the 2nd period never got restarted. When 2nd period buffer runs out, the playback stalls.

MPD
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.6.2-DEV-rev698-g8cee692-master  at 2016-09-13T09:49:14.312Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H12M12.167S" maxSegmentDuration="PT0H0M2.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash264">
 <ProgramInformation moreInformationURL="http://gpac.io">
  <Title>manifest.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period id="0" duration="PT60S">
  <AssetIdentifier schemeIdUri="urn:org:dashif:asset-id:2013" value="md:cid:EIDR:10.5240%2f0EFB-02CD-126E-8092-1E49-W"></AssetIdentifier>
  <AdaptationSet id="1" segmentAlignment="true" group="1" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="16:9" lang="eng">
   <BaseURL>video/h264/</BaseURL>
   <Representation id="1" mimeType="video/mp4" codecs="avc1.640028" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="999120">
    <SegmentTemplate timescale="12288" media="1000k/2second/tears_of_steel_1080p_1000k_h264_dash_track1_$Number$.m4s" startNumber="1" duration="24576" initialization="1000k/2second/tears_of_steel_1080p_1000k_h264_dash_track1_init.mp4" presentationTimeOffset="0"/>
   </Representation>
   <Representation id="2" mimeType="video/mp4" codecs="avc1.640028" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2003095">
    <SegmentTemplate timescale="12288" media="2000k/2second/tears_of_steel_1080p_2000k_h264_dash_track1_$Number$.m4s" startNumber="1" duration="24576" initialization="2000k/2second/tears_of_steel_1080p_2000k_h264_dash_track1_init.mp4" presentationTimeOffset="0"/>
   </Representation>
  </AdaptationSet>
  <AdaptationSet id="2" segmentAlignment="true" lang="eng">
   <BaseURL>audio/mp4a/</BaseURL>
   <Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="34189">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
    <SegmentTemplate timescale="48000" media="2second/tears_of_steel_1080p_audio_32k_dash_track1_$Number$.mp4" startNumber="1" duration="95232" initialization="2second/tears_of_steel_1080p_audio_32k_dash_track1_init.mp4" presentationTimeOffset="0"/>
   </Representation>
  </AdaptationSet>
 </Period>

 <Period id="1" duration="PT60S">
  <AssetIdentifier schemeIdUri="urn:org:dashif:asset-id:2013" value="md:cid:EIDR:10.5240%2f0EFB-02CD-126E-8092-1E49-W"></AssetIdentifier>
  <AdaptationSet id="1" segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="16:9" lang="eng">
   <BaseURL>video/h264/</BaseURL>
   <Representation id="1" mimeType="video/mp4" codecs="avc1.640028" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1013045">
    <SegmentTemplate timescale="12288" media="1000k/1second/tears_of_steel_1080p_1000k_h264_24_dash_track1_$Number$.m4s" startNumber="61" duration="12288" initialization="1000k/1second/tears_of_steel_1080p_1000k_h264_24_dash_track1_init.mp4" presentationTimeOffset="737280"/>
   </Representation>
   <Representation id="2" mimeType="video/mp4" codecs="avc1.640028" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2020878">
    <SegmentTemplate timescale="12288" media="2000k/1second/tears_of_steel_1080p_2000k_h264_24_dash_track1_$Number$.m4s" startNumber="61" duration="12288" initialization="2000k/1second/tears_of_steel_1080p_2000k_h264_24_dash_track1_init.mp4" presentationTimeOffset="737280"/>
   </Representation>
  </AdaptationSet>
  <AdaptationSet id="2" segmentAlignment="true" lang="eng">
   <BaseURL>audio/mp4a/</BaseURL>
   <Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="34881">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
    <SegmentTemplate timescale="48000" media="1second/tears_of_steel_1080p_audio_32k_dash_track1_1second_$Number$.mp4" startNumber="61" duration="47104" initialization="1second/tears_of_steel_1080p_audio_32k_dash_track1_1second_init.mp4" presentationTimeOffset="2880000"/>
   </Representation>
  </AdaptationSet>
 </Period>

 <Period id="2" duration="PT0H10M12.167S">
   <AssetIdentifier schemeIdUri="urn:org:dashif:asset-id:2013" value="md:cid:EIDR:10.5240%2f0EFB-02CD-126E-8092-1E49-W"></AssetIdentifier>
   <AdaptationSet id="1" segmentAlignment="true" group="1" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="16:9" lang="eng">
   <BaseURL>video/h264/</BaseURL>
   <Representation id="1" mimeType="video/mp4" codecs="avc1.640028" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="999120">
    <SegmentTemplate timescale="12288" media="1000k/2second/tears_of_steel_1080p_1000k_h264_dash_track1_$Number$.m4s" startNumber="61" duration="24576" initialization="1000k/2second/tears_of_steel_1080p_1000k_h264_dash_track1_init.mp4" presentationTimeOffset="1474560"/>
   </Representation>
   <Representation id="2" mimeType="video/mp4" codecs="avc1.640028" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2003095">
    <SegmentTemplate timescale="12288" media="2000k/2second/tears_of_steel_1080p_2000k_h264_dash_track1_$Number$.m4s" startNumber="61" duration="24576" initialization="2000k/2second/tears_of_steel_1080p_2000k_h264_dash_track1_init.mp4" presentationTimeOffset="1474560"/>
   </Representation>
  </AdaptationSet>
   <AdaptationSet id="2" segmentAlignment="true" lang="eng">
   <BaseURL>audio/mp4a/</BaseURL>
   <Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="34189">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
    <SegmentTemplate timescale="48000" media="2second/tears_of_steel_1080p_audio_32k_dash_track1_$Number$.mp4" startNumber="61" duration="95232" initialization="2second/tears_of_steel_1080p_audio_32k_dash_track1_init.mp4" presentationTimeOffset="5760000"/>
   </Representation>
  </AdaptationSet>
 </Period>

</MPD>
Console output

dash-stall.log

Expected behavior

The player should not stall. The seek is intra-period and should not cancel preloading of the next period. Pruning buffers might be reasonable but loading should not be canceled.

alexhmit commented 1 year ago

I just checked the fix. Looks good. Thanks for the quick action.

dsilhavy commented 1 year ago

Thanks for checking and reporting the issue :)