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

mediaPresentationDuration not fully respected (plays until end of segment) #3152

Closed
5 tasks done
dimitry-unified-streaming opened this issue Jan 10, 2020 · 5 comments
Closed
5 tasks done

Comments

@dimitry-unified-streaming
Environment
Steps to reproduce

With our Unified Origin product, we have a feature to get virtual subclips from VOD content. Depending on how the original VOD content is fragmented, you can sometimes get slight misalignments between the audio and video tracks. This is perfectly normal, as the sample times and timescales do not always line up.

In one particular case, a user noticed that dash.js seemed to be "hanging" at the end of such a clip. Here, the clip was from 06:00 to 09:32 in the Tears of Steel video, where the alignment of the media fragments is such, that the audio starts at 05:59.957 and ends at 09:35.957 (so 216.0 seconds), and the video starts at 06:00.000 and ends at 09:32.0 (so 212.0 seconds). Our software reported the mediaPresentationDuration (and the Period@duration) as the duration of the longest timeline, so as PT3M36S (03:36). This caused dash.js to stop playing at approximately 03:32, where the video timeline ends, and then hang.

While investigating this, we found a nice write up about just this case in the DASH-IF timing model document here on GitHub, talking about just this kind of thing:
https://dashif-documents.azurewebsites.net/Guidelines-TimingModel/master/Guidelines-TimingModel.html#necessary-references-static

In a static presentation, a representation SHALL provide enough media segments to cover the entire time span of the period.

E.g., what want to do is to change the mediaPresentationDuration (and Period@duration) to PT3M32S, so the span is always covered by media segments. Also, we want to adjust the presentationTimeOffset of each AdaptationSet to start at exactly 06:00.000.

An example playlist for this is here: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos.mpd. If you play this in dash.js, it seems to work well, and it initially shows a media duration of 03:32 in its scrubber bar. However, near the end of the presentation, as it is downloading the final media segments, it suddenly decides that the media duration becomes 03:35! Then, because it runs out of video at 03:32, it sits for a while emptying its buffers, and eventually decides to stop.

We think dash.js should fully respect the mediaPresentationDuration (or Period@duration) attributes, so if we tell it to not play the media until the end, it should stop exactly at the provided duration.

Another synthesized example is https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-shortened.mpd, which is exactly the same MPD, but with both mediaPresentationDuration and Period@duration set to PT1M32S. In that case, dash.js shows similar behavior as described above: it starts playing and says the media duration is 01:32, then just before the end it increases the duration to 01:35.

Observed behaviour

The observed behavior is as described above, while we think it should stop at the specified duration instead.

Console output
Debug.js:168 [112311][MediaPlayer] Streaming Initialized 
Debug.js:168 [112312][MediaPlayer] Playback Initialized 
Debug.js:168 [112374][DashParser] Parsing complete: ( xml2json: 3.54ms, objectiron: 0.0600ms, total: 0.00360s) 
Debug.js:168 [112377][ManifestUpdater] Manifest has been refreshed at Fri Jan 10 2020 16:16:49 GMT+0100 (Central European Standard Time)[1578669409.309]  
Debug.js:168 [112380][Stream] No text data. 
Debug.js:168 [112380][Stream] No fragmentedText data. 
Debug.js:168 [112380][Stream] No embeddedText data. 
Debug.js:168 [112381][Stream] No muxed data. 
Debug.js:168 [112381][Stream] No image data. 
Debug.js:168 [112383][PlaybackController] Native video element event: play 
Debug.js:168 [112384][PlaybackController] Native video element event: waiting 
Debug.js:168 [112396][BufferController][video] Init fragment finished loading saving to video's init cache 
Debug.js:168 [112396][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000.dash , Range: undefined 
Debug.js:168 [112398][ScheduleController][video] Top quality video index has changed from undefined to 0 
Debug.js:168 [112406][BufferController][audio] Init fragment finished loading saving to audio's init cache 
Debug.js:168 [112407][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008.dash , Range: undefined 
Debug.js:168 [112411][PlaybackController] Native video element event: loadedmetadata 
Debug.js:168 [112411][ScheduleController][audio] Top quality audio index has changed from undefined to 0 
Debug.js:168 [112451][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-216000.dash , Range: undefined 
Debug.js:168 [112452][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-17277952.dash , Range: undefined 
Debug.js:168 [112462][PlaybackController] Native video element event: playing 
Debug.js:168 [112473][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-17661952.dash , Range: undefined 
Debug.js:168 [112474][AbrController] [audio] switching from throughput to buffer occupancy ABR rule (buffer: 15.946). 
Debug.js:168 [112489][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-218400.dash , Range: undefined 
Debug.js:168 [112531][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-220800.dash , Range: undefined 
Debug.js:168 [112575][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-223200.dash , Range: undefined 
Debug.js:168 [112583][AbrController] [video] switching from throughput to buffer occupancy ABR rule (buffer: 15.972). 
Debug.js:168 [112613][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-225600.dash , Range: undefined 
Debug.js:168 [112653][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-228000.dash , Range: undefined 
Debug.js:168 [112707][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-230400.dash , Range: undefined 
Debug.js:168 [112745][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-232800.dash , Range: undefined 
Debug.js:168 [112999][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-18045952.dash , Range: undefined 
Debug.js:168 [113021][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-18429952.dash , Range: undefined 
Debug.js:168 [113040][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-18813952.dash , Range: undefined 
Debug.js:168 [114812][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-235200.dash , Range: undefined 
Debug.js:168 [118879][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-237600.dash , Range: undefined 
Debug.js:168 [119083][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-19197952.dash , Range: undefined 
Debug.js:168 [122997][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-240000.dash , Range: undefined 
Debug.js:168 [127078][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-242400.dash , Range: undefined 
Debug.js:168 [127127][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-19581952.dash , Range: undefined 
Debug.js:168 [131151][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-244800.dash , Range: undefined 
Debug.js:168 [134715][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-247200.dash , Range: undefined 
Debug.js:168 [135166][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-19965952.dash , Range: undefined 
Debug.js:168 [138787][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-249600.dash , Range: undefined 
Debug.js:168 [142855][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-252000.dash , Range: undefined 
Debug.js:168 [143204][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-20349952.dash , Range: undefined 
Debug.js:168 [146924][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-254400.dash , Range: undefined 
Debug.js:168 [151000][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-256800.dash , Range: undefined 
Debug.js:168 [151253][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-20733952.dash , Range: undefined 
Debug.js:168 [155066][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-259200.dash , Range: undefined 
Debug.js:168 [159137][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-261600.dash , Range: undefined 
Debug.js:168 [159289][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-21117952.dash , Range: undefined 
Debug.js:168 [163219][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-264000.dash , Range: undefined 
Debug.js:168 [166805][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-266400.dash , Range: undefined 
Debug.js:168 [167334][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-21501952.dash , Range: undefined 
Debug.js:168 [170883][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-268800.dash , Range: undefined 
Debug.js:168 [175006][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-271200.dash , Range: undefined 
Debug.js:168 [175381][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-21885952.dash , Range: undefined 
Debug.js:168 [179082][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-273600.dash , Range: undefined 
Debug.js:168 [183138][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-276000.dash , Range: undefined 
Debug.js:168 [183464][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-22269952.dash , Range: undefined 
Debug.js:168 [187201][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-278400.dash , Range: undefined 
Debug.js:168 [190781][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-280800.dash , Range: undefined 
Debug.js:168 [191017][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-22653952.dash , Range: undefined 
Debug.js:168 [194871][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-283200.dash , Range: undefined 
Debug.js:168 [198940][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-285600.dash , Range: undefined 
Debug.js:168 [199048][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-23037952.dash , Range: undefined 
Debug.js:168 [203018][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-288000.dash , Range: undefined 
Debug.js:168 [207088][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-290400.dash , Range: undefined 
Debug.js:168 [207590][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-23421952.dash , Range: undefined 
Debug.js:168 [211163][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-292800.dash , Range: undefined 
Debug.js:168 [214728][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-295200.dash , Range: undefined 
Debug.js:168 [215136][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-23805952.dash , Range: undefined 
Debug.js:168 [218804][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-297600.dash , Range: undefined 
Debug.js:168 [222873][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-300000.dash , Range: undefined 
Debug.js:168 [223180][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-24189952.dash , Range: undefined 
Debug.js:168 [227005][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-302400.dash , Range: undefined 
Debug.js:168 [231080][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-304800.dash , Range: undefined 
Debug.js:168 [231211][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-24573952.dash , Range: undefined 
Debug.js:168 [235145][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-307200.dash , Range: undefined 
Debug.js:168 [239212][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-309600.dash , Range: undefined 
Debug.js:168 [239747][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-24957952.dash , Range: undefined 
Debug.js:168 [242778][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-312000.dash , Range: undefined 
Debug.js:168 [246849][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-314400.dash , Range: undefined 
Debug.js:168 [247287][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-25341952.dash , Range: undefined 
Debug.js:168 [250914][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-316800.dash , Range: undefined 
Debug.js:168 [255003][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-319200.dash , Range: undefined 
Debug.js:168 [255345][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-25725952.dash , Range: undefined 
Debug.js:168 [259074][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-321600.dash , Range: undefined 
Debug.js:168 [263138][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-324000.dash , Range: undefined 
Debug.js:168 [263374][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-26109952.dash , Range: undefined 
Debug.js:168 [267206][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-326400.dash , Range: undefined 
Debug.js:168 [270765][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-328800.dash , Range: undefined 
Debug.js:168 [270956][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-26493952.dash , Range: undefined 
Debug.js:168 [274827][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-331200.dash , Range: undefined 
Debug.js:168 [278899][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-333600.dash , Range: undefined 
Debug.js:168 [278982][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-26877952.dash , Range: undefined 
Debug.js:168 [282996][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-336000.dash , Range: undefined 
Debug.js:168 [287065][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-338400.dash , Range: undefined 
Debug.js:168 [287540][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-audio_eng=64008-27261952.dash , Range: undefined 
Debug.js:168 [291156][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos-video_eng=1001000-340800.dash , Range: undefined 
Debug.js:168 [294696][Stream] onBufferingCompleted - One streamProcessor has finished but audio one is not buffering completed 
doLog @ Debug.js:168
warn @ Debug.js:131
onBufferingCompleted @ Stream.js:650
(anonymous) @ EventBus.js:88
trigger @ EventBus.js:88
checkIfBufferingCompleted @ BufferController.js:535
onStreamCompleted @ BufferController.js:765
(anonymous) @ EventBus.js:88
trigger @ EventBus.js:88
executeRequest @ FragmentModel.js:209
getNextFragment @ ScheduleController.js:237
schedule @ ScheduleController.js:251
setTimeout (async)
startScheduleTimer @ ScheduleController.js:299
schedule @ ScheduleController.js:254
setTimeout (async)
startScheduleTimer @ ScheduleController.js:299
schedule @ ScheduleController.js:254
setTimeout (async)
startScheduleTimer @ ScheduleController.js:299
schedule @ ScheduleController.js:254
setTimeout (async)
startScheduleTimer @ ScheduleController.js:299
schedule @ ScheduleController.js:254
setTimeout (async)
startScheduleTimer @ ScheduleController.js:299
schedule @ ScheduleController.js:254
setTimeout (async)
startScheduleTimer @ ScheduleController.js:299
schedule @ ScheduleController.js:254
setTimeout (async)
startScheduleTimer @ ScheduleController.js:299
schedule @ ScheduleController.js:254
setTimeout (async)
startScheduleTimer @ ScheduleController.js:299
onBytesAppended @ ScheduleController.js:509
(anonymous) @ EventBus.js:88
trigger @ EventBus.js:88
onAppended @ BufferController.js:314
afterSuccess @ SourceBufferSink.js:229
executeCallback @ SourceBufferSink.js:310
updateEndHandler @ SourceBufferSink.js:327
Debug.js:168 [294696][ScheduleController][video] Stream is complete 
Debug.js:168 [318659][AbrController] [video] switching from buffer occupancy to throughput ABR rule (buffer: 5.886). 
Debug.js:168 [321112][StreamController] [onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController. 
Debug.js:168 [321112][MediaSourceController] call to mediaSource endOfStream 
Debug.js:168 [321114][ScheduleController][audio] Stream is complete 
Debug.js:168 [322659][AbrController] [audio] switching from buffer occupancy to throughput ABR rule (buffer: 5.843). 
Debug.js:168 [328512][PlaybackController] Native video element event: pause 
Debug.js:168 [328513][PlaybackController] Native video element event: ended 
@dimitry-unified-streaming
Copy link
Author

@dimitry-unified-streaming dimitry-unified-streaming commented Jan 10, 2020

Also note that Shaka Player seems to behave more correctly:
https://shaka-player-demo.appspot.com/demo/#audiolang=en-US;textlang=en-US;uilang=en-US;asset=https://test.unified-streaming.com/dashif/tears-of-steel-0600-0932/tos.mpd;panel=HOME;build=uncompiled

E.g, it shows the media duration as 03:32 from the beginning to the end, and plays exactly until frame 13727, which is at 09:31.958 (the next frame 13728 is exactly at 09:32.000).

@nicosang
Copy link
Contributor

@nicosang nicosang commented Jan 10, 2020

Hi @dimitry-unified-streaming ,

currently dash.js doesn't use appendWindowEnd property of Sourcebuffer. So when a media segment is pushed, duration of video element is updated. In your sample stream, when the last audio segment is pushed, audio buffered range equals 191.957333 - 215.957333. Video duration is updated in order to show end of stream at 3m35.
I did a test with the appendWindowEnd, it works correctly : after the last audio segment is pushed, duration is not updated (=>3m32).....

So, a new PR has to be done to use this parameter.....and maybe take a look at appendWindowStart could be interessting to resolve start alignment issues....

Nico

@dimitry-unified-streaming
Copy link
Author

@dimitry-unified-streaming dimitry-unified-streaming commented Jan 13, 2020

Aha, indeed Shaka player seems to use appendWindowEnd in quite a lot of places. But in general, do you agree that players should only play to the specifie duration, and not the end of the segment or timeline?

E.g., if I would compose an MPD with the complete Tears of Steel clip (which is 12:14 long) in its timeline, but specified a Period@duration of, say, 5 minutes, it should only play the first 5 minutes. If the end of the duration falls in the middle of a segment, it should play until that middle, not to the end of a segment.

@dsilhavy dsilhavy added this to the 3.1.0 milestone Feb 11, 2020
@dsilhavy
Copy link
Collaborator

@dsilhavy dsilhavy commented Feb 11, 2020

@dimitry-unified-streaming Agreed, the MPD is the point of truth.

@dsilhavy
Copy link
Collaborator

@dsilhavy dsilhavy commented Feb 12, 2020

This is now handed by using the appendWindowEnd of the Sourcebuffer, see #3153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants