-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Shaka 2.0 and stream interruption #555
Comments
And the simpliest way is to support discontinuity between periods (when period1.start + period1.duration < period2.start). I've already made a patch for this and it would be great if you'll be able to review it. |
We don't currently support discontinuity at all, but I'd love to see your patch. Perhaps I have been over-complicating it. As for short periods and dummy content, we don't have any such content available. Can you provide a test stream so that we can take a look? |
Thanks, Joey. you can find my commit here: I didn't make a pull request because it breaks a lot of test cases and it's not ready for merge. |
@baconz, this seems related to a conversation we were having about gaps. @agelun, it appears that you detect when the playhead is in a gap, and move it to the other side. This is something we have considered before and decided not to do. I took a look at the sections of the IOP you referenced. (The same content appears in the same sections in the most up-to-date version of IOP, v3.3.) My reading of the IOP is that there are three mechanisms:
It appears that using 404s is the same as short periods in concept. Both indicate that segments are not available and will not be available. The main difference is in when the player finds out. A short period tells the player at manifest parse time that there's no content. A 404 when fetching a segment tells the player later, when it starts trying to buffer the relevant section of the presentation. I dislike using 404s for this because there are other ways to encounter them, such as bad clock sync or a misbehaving server. If the player is expected to happily move past 404s, it may make debugging certain server problems more difficult. Short periods are more clear, but still don't fit into our current architecture. We don't expect to be able to play through gaps, and these empty periods just signal "here's a gap". I'm not sure if/when we would be able to support gaps. Because of the way MediaSource works, I believe it is difficult for JS-based players to deal with gaps elegantly. I'm averse to extra complexity in the player. |
@joeyparrish there's one more option that we discussed, which would be to leave out the empty period, but apply an adjustment to the live head, pulling it back by a duration equivalent to the gap length. This method is not yet supported in the spec, but I think that barring a true server-side solution (ie filling the gaps with a "slate"), it might be the simplest fix. I'm happy to submit a ticket to the IOP if others think that this would be helpful. |
I would like to point out some additional complexity, especially with live streams. Empty periods and dummy content might be technically feasible for on-demand content but for live content, the backend often might not even have the ability to detect missing pieces, let alone do something about them. Many packagers simply deliver segments over FTP to a CDN origin and if one segment gets lost then too bad - it will just skip the segment and carry on. This should not happen but real world network conditions can be nonideal, so I have seen it quite a lot in practice - there's a gap of one or more segments, after which the stream continues just fine. Maybe not very often but perhaps just once a day. If players do not skip past 404s, this means that live streams will suddenly stall at random moments in time, for all (or a large subset of) users simultaneously. This makes users rather unhappy. |
@joeyparrish can you explain why did you decide not to "jump over" the gap? Are there any tech reasons or just code style/simplicity/etc.? I thought about #462 as well and both cases can be solved if you create something like "event bus" for stream events, I think. There could be pushed MPD events from EventStream tag and discontinuity events (in case of periods interruption, empty periods and 404 responses – all from different sources) and application will be able to choose when/how to react on such events (for example, jump over, stuck, show error message etc. for discontinuity events). It can be used to draw informative timeline as well. I need to understand how can we progress with this issue, should we support our own branch to cover such "real life" requirements or it can be merged into google's code. Or, maybe, there are some more serious reasons I don't know about and it cannot work well at all? |
We decided not to jump over the gap for many reasons, but I think they are becoming increasingly irrelevant. Let's figure out the best solution and work toward getting it merged into Shaka Player. In my view, there are many reasons for gaps:
I don't see any good way to differentiate between these three cases, so probably it's best to try to handle all gaps. One thing that worries me is the use of 404s to signal discontinuities. There are other times a 404 may occur:
I'm unsure how to differentiate the third case from the other two. Perhaps we could have a heuristic for that, such as We've also discussed two different strategies for handling gaps:
Thoughts? Specifically on:
|
Hello, Joey. Thanks for reply. Step by step:
And I don't understand why you think it'll be more complex for app developer. Event can be ignored and playback will stop (like now). |
This topic is currently also under discussion/development in the dash.js player. Perhaps some collaboration might be beneficial. I link here the dash.js discussion on the topic. |
I have an issue with DASH + Widevine Live stream that player make requests for the segment with segment number -1 and the response from the server of course is 404. @joeyparrish Can the reason for that be temporary stream unavailability as well? |
@dobrusev That seems unlikely. If the player is requesting a bad segment number, that seems like a bug. Please file a new issue, preferably with a link to the manifest. |
@joeyparrish @TheModMaker Seems this was pushed out to vLater (not sure what that means) ... any chance this is still being actively considered/pursued? Last update looks to be sometime late last year? if we're generating a live manifest and we experience a stream loss, it would be nice to be able to include an empty |
We plan to implement what we are calling "gap jumping": automatically jumping the play head over gaps in the timeline. vLater meant that it is not scheduled for a specific release yet. (This milestone has since been renamed to "Backlog".) We have decided to wait until after v2.1.0 is released, to avoid any risk to that release. We will release a design doc in the near future, and link to it here. Thank you for your patience with this issue. Tolerating gaps in the timeline is a big change in behavior for Shaka Player, and we are being very careful. |
@joeyparrish Thanks for the update! Good to know. We'll keep our eye out that design doc and progress on this in the future. For our purposes, we plan on creating a period with placeholder content to bridge the gap. Hopefully that'll get us past this for now. |
This adds the new configuration options that will be used in gap jumping. This also changes Playhead to accept the config over the rebuffing goal directly. Issue #555 Change-Id: I467690ad1f417e69634087e04e0b44c98e1c9b81
Issue #555 Change-Id: Ifb8525ad8924f2581f1aa72bc2278b8bc9d857f3
We just pushed a design doc for our implementation of gap jumping. I have also started working on it and hope to have something in within the next week or two. The basic idea is for encoders to introduce gaps in the manifest (e.g. missing segments, or Periods with both a |
Now the DASH parser will remove gaps that appear between Periods. It removes the gaps by adjusting the duration of the previous Period to fill the gap. Because it affects the duration, the last segment of the Period will also be adjusted. This only affects the segment index; if this adjustment results in gaps in the media, they will not be jumped (yet). Issue #555 Change-Id: Idd2cd7ad960855be01565615c8917f7191b29503
The bulk of the logic for gap jumping is handled in Playhead. It tracks the current buffered ranges and jumps over any gaps that appear. It listens for a special browser event ('waiting') for when the video element runs out of playable frames. This change also removes the logic for jumping gaps at the beginning of the timeline. This is handled by the more general gap jumping logic and works cross-browser. Finally, this updates the buffering logic to only count the amount of content buffered (i.e. ignoring the gaps). This fixes some bugs where gaps in the content can result in StreamingEngine buffering forever since it thinks only a little is buffered. This includes full implementation of the logic, but this doesn't close the issue since there aren't any integration tests yet. Those will be added next. Issue #555 Change-Id: Id99eb9fe469e8cf2c7464a3d70c3733791e806e0
We just pushed the main implementation of gap jumping. Now any gaps that appear in the media or the manifest will be jumped automatically. You can see it live on the nightly page. "Small" gaps are jumped automatically. These are gaps smaller than |
Latest master (6d0f081)
According to http://dashif.org/wp-content/uploads/2015/04/DASH-IF-IOP-v3.0.pdf "4.8.3" and "4.8.5" (page 67) we have two options to indicate temporary stream unavailability:
But in first case Shaka reports about invalid MPD (no AdaptationSet/Representation) or stucks before such "dummy" period (in case of stream info absence).
In second case (404 response) Shaka makes repeated attempts to get a chunk and doesn't continue playback until we move scrollbar (or until chunk suddenly appears).
What do you recommend to use for temporary stream unavailability indication?
Are you going to handle 404 responses and "dummy periods" according to DASH-IF-IOP?
Thank you.
The text was updated successfully, but these errors were encountered: