mediaPresentationDuration not fully respected (plays until end of segment) #3152
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
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:
E.g., what want to do is to change the
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
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
The observed behavior is as described above, while we think it should stop at the specified duration instead.
The text was updated successfully, but these errors were encountered:
Also note that Shaka Player seems to behave more correctly:
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).
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
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....
Aha, indeed Shaka player seems to use
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