Dash.js: player is not playing before the whole stream is downloaded.

Created on 19 Dec 2019  路  5Comments  路  Source: Dash-Industry-Forum/dash.js

Environment

Steps to reproduce
  1. Please provide clear steps to reproduce your problem
    Load the manifest https://liveradio.s3.eu-central-1.amazonaws.com/manifest.mpd
  2. If the bug is intermittent, give a rough frequency if possible
Observed behaviour

Describe what the player is doing that is unexpected or undesired behaviour.
The player waits for the whole stream to be downloaded instead to start/become playable as soon as the initial bytes are read

Console output

I think the important log is [19671][Stream] onBufferingCompleted - One streamProcessor has finished but video one is not buffering completed
full log below

Debug.js:209 [13239][MediaPlayer] Streaming Initialized 
Debug.js:209 [13247][MediaPlayer] Playback Initialized 
Debug.js:209 [13554][DashParser] Parsing complete: ( xml2json: 3.32ms, objectiron: 0.185ms, total: 0.00351s) 
Debug.js:209 [13559][StreamController] SegmentTimeline detected using calculated Live Edge Time 
Debug.js:209 [13562][StreamController] MediaSource attached to element.  Waiting on open... 
Debug.js:209 [13563][ManifestUpdater] Manifest has been refreshed at Thu Dec 19 2019 17:03:33 GMT+0200 (Eastern European Standard Time)[1576767813.589]  
Debug.js:209 [13570][StreamController] MediaSource is open! 
Debug.js:209 [13571][StreamController] Duration successfully set to: 1867.6 
Debug.js:209 [13572][EventController] Added 0 inline events 
Debug.js:209 [13573][Stream] video codec: video/webm;codecs="vp9" 
Debug.js:209 [13583][Stream] audio codec: audio/webm;codecs="opus" 
Debug.js:209 [13584][Stream] No text data. 
Debug.js:209 [13584][Stream] No fragmentedText data. 
Debug.js:209 [13584][Stream] No embeddedText data. 
Debug.js:209 [13584][Stream] No muxed data. 
Debug.js:209 [13585][Stream] No image data. 
Debug.js:209 [13587][ScheduleController][video] Schedule Controller starts 
Debug.js:209 [13587][ScheduleController][audio] Schedule Controller starts 
Debug.js:209 [13588][StreamController] SourceBuffer changeType method supported. Use it to switch codecs in periods transitions 
Debug.js:209 [13588][EventController] Start Event Controller 
Debug.js:209 [13598][PlaybackController] Native video element event: play 
Debug.js:209 [13599][StreamController] [onPlaybackStarted] 
Debug.js:209 [13599][PlaybackController] Native video element event: waiting 
Debug.js:209 [13603][AbrController] AbrController (video) stay on 0/0 (buffer: 0) 
Debug.js:209 [13603][ScheduleController][video] Quality has changed, get init request for representationid = 0 
Debug.js:209 [13604][ScheduleController][video] isFragmentProcessingInProgress is already equal to true 
Debug.js:209 [13616][AbrController] AbrController (audio) stay on 0/0 (buffer: 0) 
Debug.js:209 [13616][ScheduleController][audio] Quality has changed, get init request for representationid = 1 
Debug.js:209 [13616][ScheduleController][audio] isFragmentProcessingInProgress is already equal to true 
Debug.js:209 [13875][BufferController][video] Init fragment finished loading saving to video's init cache 
Debug.js:209 [13875][BufferController][video] Append Init fragment video  with representationId: 0  and quality: 0 , data size: 220 
Debug.js:209 [13876][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://liveradio.s3.eu-central-1.amazonaws.com/video.webm , Range: 0-219 
Debug.js:209 [13878][ScheduleController][video] Top quality video index has changed from undefined to 0 
Debug.js:209 [13879][AbrController] AbrController (video) stay on 0/0 (buffer: 0) 
Debug.js:209 [13879][DashHandler] Getting the request for video time : 0 
Debug.js:209 [13880][DashHandler] Index for video time 0 is 0 
Debug.js:209 [13881][ScheduleController][video] Next fragment request url is https://liveradio.s3.eu-central-1.amazonaws.com/video.webm 
Debug.js:209 [13935][BufferController][audio] Init fragment finished loading saving to audio's init cache 
Debug.js:209 [13935][BufferController][audio] Append Init fragment audio  with representationId: 1  and quality: 0 , data size: 259 
Debug.js:209 [13936][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://liveradio.s3.eu-central-1.amazonaws.com/audio.webm , Range: 0-258 
Debug.js:209 [13939][PlaybackController] Native video element event: loadedmetadata 
Debug.js:209 [13940][ScheduleController][audio] Top quality audio index has changed from undefined to 0 
Debug.js:209 [13941][AbrController] AbrController (audio) stay on 0/0 (buffer: 0) 
Debug.js:209 [13941][DashHandler] Getting the request for audio time : 0 
Debug.js:209 [13941][DashHandler] Index for audio time 0 is 0 
Debug.js:209 [13942][ScheduleController][audio] Next fragment request url is https://liveradio.s3.eu-central-1.amazonaws.com/audio.webm 
Debug.js:209 [15977][PlaybackController] Requesting seek to time: 185 
Debug.js:209 [15991][PlaybackController] Seeking to: 185 
Debug.js:209 [15994][BufferController][video] Waiting for more buffer before starting playback for video 
Debug.js:209 [15995][ScheduleController][video] onPlaybackSeeking for video, call fragmentModel.abortRequests in order to seek quicker 
Debug.js:209 [15997][ScheduleController][video] onFragmentLoadingAbandoned for video, request: https://liveradio.s3.eu-central-1.amazonaws.com/video.webm has been aborted 
Debug.js:209 [16001][ScheduleController][video] onFragmentLoadingAbandoned for video, request: https://liveradio.s3.eu-central-1.amazonaws.com/video.webm has been aborted 
Debug.js:209 [16001][ScheduleController][video] isFragmentProcessingInProgress is already equal to false 
Debug.js:209 [16003][BufferController][audio] Waiting for more buffer before starting playback for audio 
Debug.js:209 [16003][ScheduleController][audio] onPlaybackSeeking for audio, call fragmentModel.abortRequests in order to seek quicker 
Debug.js:209 [16005][ScheduleController][audio] onFragmentLoadingAbandoned for audio, request: https://liveradio.s3.eu-central-1.amazonaws.com/audio.webm has been aborted 
Debug.js:209 [16006][ScheduleController][audio] onFragmentLoadingAbandoned for audio, request: https://liveradio.s3.eu-central-1.amazonaws.com/audio.webm has been aborted 
Debug.js:209 [16007][ScheduleController][audio] isFragmentProcessingInProgress is already equal to false 
Debug.js:209 [16011][AbrController] AbrController (video) stay on 0/0 (buffer: 0) 
Debug.js:209 [16011][DashHandler] Getting the request for video time : 185 
Debug.js:209 [16011][DashHandler] Index for video time 185 is 0 
Debug.js:209 [16012][ScheduleController][video] Next fragment request url is https://liveradio.s3.eu-central-1.amazonaws.com/video.webm 
Debug.js:209 [16013][AbrController] AbrController (audio) stay on 0/0 (buffer: 0) 
Debug.js:209 [16013][DashHandler] Getting the request for audio time : 185 
Debug.js:209 [16014][DashHandler] Index for audio time 185 is 0 
Debug.js:209 [16014][ScheduleController][audio] Next fragment request url is https://liveradio.s3.eu-central-1.amazonaws.com/audio.webm 
Debug.js:209 [19510][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://liveradio.s3.eu-central-1.amazonaws.com/audio.webm , Range: undefined 
Debug.js:209 [19660][BufferController][audio] Buffered Range for type: audio : 0  -  1840.641  currentTime =  185 
Debug.js:209 [19661][AbrController] AbrController (audio) switching from throughput to buffer occupancy ABR rule (buffer: 1655.641). 
Debug.js:209 [19662][BufferController][audio] Got enough buffer to start for audio 
Debug.js:209 [19667][AbrController] AbrController (audio) stay on 0/0 (buffer: 1655.641) 
Debug.js:209 [19668][DashHandler] Getting the next request at index: 1, type: audio 
Debug.js:209 [19669][DashHandler] Signal complete - audio 
Debug.js:209 [19669][ScheduleController][audio] Next fragment request url is null 
Debug.js:209 [19670][FragmentModel] executeRequest trigger STREAM_COMPLETED 
Debug.js:209 [19670][BufferController][audio] checkIfBufferingCompleted trigger BUFFERING_COMPLETED 
Debug.js:209 [19671][Stream] onBufferingCompleted - One streamProcessor has finished but video one is not buffering completed 
doLog @ Debug.js:209
warn @ Debug.js:172
onBufferingCompleted @ Stream.js:646
(anonymous) @ EventBus.js:88
trigger @ EventBus.js:88
checkIfBufferingCompleted @ BufferController.js:536
onStreamCompleted @ BufferController.js:766
(anonymous) @ EventBus.js:88
trigger @ EventBus.js:88
executeRequest @ FragmentModel.js:209
getNextFragment @ ScheduleController.js:232
schedule @ ScheduleController.js:246
setTimeout (async)
startScheduleTimer @ ScheduleController.js:287
onBytesAppended @ ScheduleController.js:499
(anonymous) @ EventBus.js:88
trigger @ EventBus.js:88
onAppended @ BufferController.js:315
afterSuccess @ SourceBufferSink.js:229
executeCallback @ SourceBufferSink.js:310
updateEndHandler @ SourceBufferSink.js:327
Debug.js:209 [19674][ScheduleController][audio] Schedule Controller stops 
Debug.js:209 [19675][ScheduleController][audio] Stream is complete 

Most helpful comment

Your manifest is incorrect. Change it to the below and it will play as you expect.

<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" mediaPresentationDuration="PT30M67.6S" minBufferTime="PT2.2S">
    <ProgramInformation/>
    <Period id="0" start="PT0.0S">
        <AdaptationSet id="0" contentType="video" segmentAlignment="true" bitstreamSwitching="true" lang="und">
            <Representation id="0" mimeType="video/webm" codecs="vp9" bandwidth="770153" width="854" height="480" frameRate="23421/1000">
                <BaseURL>https://liveradio.s3.eu-central-1.amazonaws.com/video.webm</BaseURL>
                <SegmentBase indexRange="220-6592">
                    <Initialization range="0-219"/>
                </SegmentBase>
            </Representation>
        </AdaptationSet>
        <AdaptationSet id="1" contentType="audio" segmentAlignment="true" bitstreamSwitching="true" lang="und">
            <Representation id="1" mimeType="audio/webm" codecs="opus" bandwidth="115412" audioSamplingRate="48000">
                <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
                <BaseURL>https://liveradio.s3.eu-central-1.amazonaws.com/audio.webm</BaseURL>
                <SegmentBase indexRange="259-3444">
                    <Initialization range="0-258"/>
                </SegmentBase>
            </Representation>
        </AdaptationSet>
    </Period>
</MPD>

Note the SegmentBase rather than a SegmentList containing a single 30 minute segment.

All 5 comments

Hi,

your stream has only one audio and video segment according to dash.js. So, when dash.js has finished to download the video segment (biggest one), the streams is correctly played.

The line [19671][Stream] onBufferingCompleted - One streamProcessor has finished but video one is not buffering completed only indicates that end of stream can't be detected until all video datas are correctly downloaded.

Nico

Hi Nico,

The manifest file provides the Initialization range. Shouldn't that be enough for the player to get started? Youtube is using one audio and video segment as well along with only one index range so I assume the meta data required to provide a smooth playback should be in the Initialisation index range.

Mihai.

Your manifest is incorrect. Change it to the below and it will play as you expect.

<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" mediaPresentationDuration="PT30M67.6S" minBufferTime="PT2.2S">
    <ProgramInformation/>
    <Period id="0" start="PT0.0S">
        <AdaptationSet id="0" contentType="video" segmentAlignment="true" bitstreamSwitching="true" lang="und">
            <Representation id="0" mimeType="video/webm" codecs="vp9" bandwidth="770153" width="854" height="480" frameRate="23421/1000">
                <BaseURL>https://liveradio.s3.eu-central-1.amazonaws.com/video.webm</BaseURL>
                <SegmentBase indexRange="220-6592">
                    <Initialization range="0-219"/>
                </SegmentBase>
            </Representation>
        </AdaptationSet>
        <AdaptationSet id="1" contentType="audio" segmentAlignment="true" bitstreamSwitching="true" lang="und">
            <Representation id="1" mimeType="audio/webm" codecs="opus" bandwidth="115412" audioSamplingRate="48000">
                <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
                <BaseURL>https://liveradio.s3.eu-central-1.amazonaws.com/audio.webm</BaseURL>
                <SegmentBase indexRange="259-3444">
                    <Initialization range="0-258"/>
                </SegmentBase>
            </Representation>
        </AdaptationSet>
    </Period>
</MPD>

Note the SegmentBase rather than a SegmentList containing a single 30 minute segment.

thanks @davemevans .
@mihaiav , as you can see in your log, initialization segments are correctly downloaded with appropriate byte range.
the missing part, as David explained, is the downloading of index range to get segment lists and then download each segment separately...

Nico

@davemevans thanks a lot for your help! With the updated manifest the player works great!

Was this page helpful?
0 / 5 - 0 ratings