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

Various issues with multi-period live streams #310

Closed
joeyparrish opened this issue Mar 21, 2016 · 9 comments
Closed

Various issues with multi-period live streams #310

joeyparrish opened this issue Mar 21, 2016 · 9 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@joeyparrish
Copy link
Member

@perses added to #285 with a specific manifest that did not work. That manifest had three interesting features:

  1. Used <Location> to track sessions across manifest updates (Support <Location> for MPD updates #298)
  2. Used presentationTimeOffset for the first period (Fix presentationTimeOffset handling in v2 #297)
  3. Added new Period during manifest updates to extend the timeline

Now that 1 & 2 are solved, I have found that 3 does not work.

Technical details: presentationTimeline.duration_ grows as the manifest is updated, but video.duration does not.

@joeyparrish joeyparrish added the type: bug Something isn't working correctly label Mar 21, 2016
@joeyparrish joeyparrish added this to the v2.0.0 milestone Mar 21, 2016
@ct1n
Copy link

ct1n commented Mar 21, 2016

Since commenting on #285 I've realized that what I said about there being a difference between PTO and the first segment timestamp is quite probably wrong: DASH-IF Interoperability Points (http://dashif.org/w/2015/04/DASH-IF-IOP-v3.0.pdf) states, in section 4.4.3.3:

In order to make the MPD joining friendly and to remove data that is available in the past,
any segments that have fallen out of the time shift buffer may no longer be announced in
the MPD. In this case, the Period start may be moved by changing one or both,
MPD@availabilityStartTime and Period@start. However, this requires that the
@startNumber, @presentationTimeOffset and S values need to be updated such
that the Segment Information according to section 4.3.2.2.6 is not modified over an MPD
update.

This means we should probably update our server to have the Period start and PTO to match the new first segment (e.g., instead of Period start PT0S, PTO 5000, first segment ts 10000 we should have Period start PT5S, PTO 10000, first segment ts 10000).

However, I'm not sure this has any effect on shaka (note that the effective timestamp, availabilityStartTime + periodStart + ts - PTO, is the same).

@joeyparrish
Copy link
Member Author

The stream in question is not treated as live because even though the duration grows, it has a finite duration.

If streaming catches up to the current duration, we call endOfStream(), after which duration can no longer be extended.

@joeyparrish joeyparrish changed the title Adding periods in manifest updates does not work yet Can't add periods in finite-duration manifest Mar 21, 2016
@joeyparrish
Copy link
Member Author

@perses, if the format of this manifest is not in a stable state, I will stop work and wait for you to fix it. May I ask what product is generating this content?

While you are working on your server, please test on the latest Shaka from the master branch. It supports multiple periods, presentationTimeOffset, and <Location>. To temporarily work around the endOfStream issue, edit shaka.media.StreamingEngine.prototype.update_ and change this:

  // Check if we've buffered to the end of the presentation.
  if (timeNeeded >= timeline.getDuration()) {

to this:

  // Check if we've buffered to the end of the presentation.
  if (timeNeeded >= timeline.getDuration() && 0) {

Once your server and manifest format are in a state you are happy with, please let us know and we will work to find a more permanent solution for this endOfStream issue.

@joeyparrish joeyparrish self-assigned this Mar 21, 2016
@joeyparrish
Copy link
Member Author

@perses, while you are making changes, you should add an AdaptationSet id. Without this, Shaka can't be certain that the AS from one manifest matches the other, and therefore can't merge the timelines correctly.

@joeyparrish
Copy link
Member Author

Actually, on second look, Representation IDs are unique within the Period according to the spec. AdaptationSet IDs should not be required. We'll fix that.

@joeyparrish
Copy link
Member Author

One more bug on our end: your presentation should not be considered to have a finite duration. We'll fix that as well.

shaka-bot pushed a commit that referenced this issue Mar 21, 2016
Lookup times when transitioning from one Period to another, need to be
relative to the presentation, not the next period.

I'm not sure when this broke.

Relates to #310

Change-Id: I6e3f94bb9c6aad8c8f3ef73e73b0073e015f796e
@joeyparrish joeyparrish changed the title Can't add periods in finite-duration manifest Various issues with multi-period live streams Mar 21, 2016
shaka-bot pushed a commit that referenced this issue Mar 22, 2016
When updating a DASH manifest, we can key off of Period and
Representation only.  The spec says that Representation IDs are unique
within the Period, and that Period IDs are unique within the
presentation.  Therefore we do not need an AdaptationSet ID to merge
on update.

Relates to #310

Change-Id: I12b9f83c2bfda958a14e9ee31d459c04da8722e6
shaka-bot pushed a commit that referenced this issue Mar 22, 2016
Multi-period live streams have no presentation duration and have no duration
on the final period.

In this case, we were setting the timeline duration to the start time of the
final period, based on end = start + duration with duration == null.

This fixes the situation so that timeline duration is infinite.

Relates to #310

Change-Id: I8592318e3d4c5643fa1fcc03b34624957a2e974c
@ct1n
Copy link

ct1n commented Mar 22, 2016

Thanks for looking into this!
Our server is called "AIS Streamer" and is used for server-side ad insertion by a lot of broadcasters.

We've tried the player with these 3 commits but it seems it's not working anymore. Before it was playing about one minute (including proper period switching) and stopping. Not it's not playing at all.

shaka-bot pushed a commit that referenced this issue Mar 22, 2016
This allows for updates on SegmentTimelines where there is no startNumber.

Issue #310

Change-Id: Ic3df664e5d2369d02166bf6584c341b401b1efd9
@ct1n
Copy link

ct1n commented Mar 29, 2016

In the end we've decided not to implement the recommendation from DASH-IF Interoperability Points according to which we should update period start and PTO when segments are removed from the beginning. It doesn't sound like it's mandatory and it causes problems in both Shaka (we previously thought it didn't but there are apparently issues), and other players. It also seems more logical to keep them at their initial value as this provides more information.

We've updated the server at http://31.14.160.192:8000/ah/manifest.mpd with a new version. The only real difference is that the availabilityStartTime has been fixed between updates (it used to drift by one or two seconds). Further updates to the way our manifests look will be minor, if any.

We're happy to say that with #315 we have uninterrupted, smooth playback, for many hours (as long as we have tested).

Thanks very much for your help!

@joeyparrish
Copy link
Member Author

No problem. I'll ask that #315 close #310, then. Thanks for working with us on this.

@joeyparrish joeyparrish modified the milestones: v2.0-beta, v2.0.0 Mar 29, 2016
@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

3 participants