Closed haozhenxiao closed 5 years ago
@haozhenxiao, could you please also share console logs?
Thanks
@epiclabsDASH Here is the console log:
Doesn't look like dash.js logs, those are just network logs. Which version of Firefox/Chrome are you using?
Firefox 52.02. There are no Errors or Warnings in the log.
There appear to be gaps at the start of periods.
Take the last period, starting at 8767634400000.
First video segment is at 8767634523680 which is 123 680 units or 1.37 seconds after the period start.
First audio segment is at 8767634523060 which is 123 060 units or 1.37 seconds after the period start.
In general, without speaking of spec-conformance, content with gaps is unlikely to play in many players.
There are players that implement gap jumping as what I would call an emergency measure but if possible, I suggest ensuring that your MPD does not leave any gaps in any periods. Where a segment overlaps multiple periods, I would expect that segment to be described in both periods.
@sandersaares The period start time is earlier than the first segment start, but there's presentationTimeOffset which equals to the period start time.
presentationTimeOffset
simply says what media timeline timestamp starts the period. There is still a gap between the start of a period and the first segment. The use of presentationTimeOffset
here appears correct (I assume the intent is that the timestamps in the period IDs match the media timeline) but it does not affect the presence or absence of the gap.
For there not to be a gap in a period starting at 8767634400000, the first segment needs to start at 8767634400000. This segment may potentially contain some data from before 8767634400000 (given that this timestamp may be in the middle of a sample, for example), which is why presentationTimeOffset
exists to tell the client to discard the data before the period start.
@sandersaares The use of presentationTimeOffset here is mainly to deal with removing segments from the top of the first period, if segments on the top of the first period is being removed, the first segment start time is always changing, if the period start time always matches the first segments start time, then the period start time is always changing as well, can we have a period start time always changing? The "GAP" here is actually the segments which have been removed.
The main issue for us is that Dash players always start playing from the first periods, where the segments are being removed and not appended, I think that's why the player just plays a couple of segments in the first period then stops. How to make the player start playing from the last period? With my current implementation, if there's only one period, the player just plays fine.
And I don't agree that if the period start time is earlier than the first segment start time, then there's a gap. The definition of Peirod@start is The PeriodStart time is used as an anchor to determine the MPD start time of each Media Segment as well as to determine the presentation time of each each access unit in the Media Presentation timeline, all segments in the period use the same anchor, so as long as there's no gap between segments, the timeline have no gaps.
The "GAP" here is actually the segments which have been removed.
All periods that I looked at seemed to have this "gap". I would expect only the oldest period to be affected by removal of segments. Are we speaking of different things? My example calculations were for the newest period.
And I don't agree that if the period start time is earlier than the first segment start time, then there's a gap.
I agree with you that this content does not necessarily violate any specification. I am just saying that players tend not to play content like this. You will experience greater success if your segments cover the entire period (at least within the time shift buffer).
Any ideas how to let the player start playing from the last period? My current implementation works fine with Shaka player.
@sandersaares You are right, all periods have the "gap", but except the first(oldest) period, the "gap" for other periods are tiny, the newest period has about 1.3 seconds of "gap". Is this the reason why the player only plays the first period and not continue across to the next period?
I think so, @haozhenxiao. As @sandersaares pointed out, players tend to not play content with gaps so my first recommendation, independently of what dash.js supports, is you to try to fix this gap issue.
Talking specifically about dash.js, we are currently not supporting gaps in the stream (playback gets stalled when there is a gap). Supporting gaps was incompatible with our previous buffer management procedure. Good news is implementing a solution for gaps will be possible with the new buffer management procedure included in dash.js v2.6.6 (to be released by Feb 14th). So, stay tuned, solution will come soon.
We have created a test stream which works well with shaka player (2.3.2) and the bitmovin test player. This is a simulated live stream which in dash-if stops playing as described in the issue description.
We have made sure there are no gaps/overlaps so that is clearly not the issue here. The manifest has also been de-cluttered by removing audio representations and only having a single video representation.
Not sure if this is causal, but If that mpd is run through the conformance tool at http://dashif.org/conformance.html it indicates that the UTCTiming element is not in the expected location.
Line:Col[15:87]:cvc-complex-type.2.4.a: Invalid content was found starting with element 'UTCTiming'. One of '{"urn:mpeg:dash:schema:mpd:2011":ProgramInformation, "urn:mpeg:dash:schema:mpd:2011":BaseURL, "urn:mpeg:dash:schema:mpd:2011":Location, "urn:mpeg:dash:schema:mpd:2011":Period}' is expected. MPD validation not successful - DASH is not valid!
If you compare to one of the test vectors http://vm2.dashif.org/livesim/utc_direct/testpic_2s/Manifest.mpd that pass conformance, the element is added after the period definitions. Not sure if this even affects how the dash.js framework uses the information.
Re-reading the xsd I see that it uses
Re-testing in player shows no difference in observed behaviour.
@epiclabsDASH As mentioned above, we've fixed the validation and tested the stream with no gaps on v2.6.6, the behaviour is still the same, any suggestions?
Hi @haozhenxiao ,
your stream seems to not be available now....Have you found the solution? If not, could you please restore access to it?
Thanks, Nico
No - just a maintenance upgrade. Back in 5.
Hi @dsparacio ,
I have a little question for you according this issue. Could you, please, tell me why, in live segmentTimeline use case, the isMediaFinished function (in DashHandler) always returns false? We have, in this case, multiple periods. So, in order to switch to next period, we have to detect the end of the current one : according to my comprehension, it is done at the beginning by this isMediaFinished function...
Thanks, Nico
The simulated live stream was removed by accident, here is a new link to reproduce issue.
The link passes the conformance tests and the problem is still present in latest reference client. As noted above the link plays fine in shaka player and theoplayer, however the dashif client plays the last seconds of the first period as if it was live.
I found that for number-based manifest, TemplateSegmentsGetter returns segments beyond the end of period, possibly due to some projection logic on the number-based timeline. However, for time-based manifest like the one provided by @grukx , TimelineSegmentsGetter returns only segments actually belong to the period.
The isMediaFinished function only return true when the current segment indexed by the "index" variable is beyond the period end. So I think that's way number-based manifests work, but time-based manifests don't.
Environment
Steps to reproduce
Observed behaviour
The live manifest produced from my server has been tested with shaka player, but when I test it with dash js, it only plays the end of the first period and not requesting segments anymore. As shown in the image, it's only requesting the manifest but not segments.
Console output
This is the snapshot of the manifest.