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

Recovery from failed/slow segment fetching? #166

Closed
Feenposhleen opened this issue Aug 25, 2015 · 6 comments
Closed

Recovery from failed/slow segment fetching? #166

Feenposhleen opened this issue Aug 25, 2015 · 6 comments
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly

Comments

@Feenposhleen
Copy link

Hi

We have been experiencing some issues possibly introduced in the later (1.4.0 & 1.4.1) releases. Whenever a live stream stops to buffer (because of network issues etc.), the player never resumes playback by itself, even though it eventually fills the required buffer. If you manually trigger the play method, playback resumes just fine.

This can be easily reproduced by throttling the network speed during playback until playback stops, and then stop throttling.

As a quick fix, we have considered to repeatedly call the play method during buffering pauses, but this is of course less than ideal.

Is this a known issue? Is there a way to find out when enough buffer is filled for playback to resume?

Thank you

@tdrews tdrews self-assigned this Aug 25, 2015
@tdrews tdrews added the type: bug Something isn't working correctly label Aug 25, 2015
@tdrews
Copy link
Contributor

tdrews commented Aug 25, 2015

There is a bug. The Player exits the buffering state when the streams have re-buffered minBufferTime (MPD attribute) seconds of content. However, if minBufferTime > streamBufferSize (which defaults to 15) then the streams will never buffer enough content to exit the buffering state.

To rule out any other issues: is your minBufferTime set to something larger than 15 seconds or are you setting streamBufferSize explicitly?

@Feenposhleen
Copy link
Author

Yes, we have a minBufferTime of 30, and have not touched the shaka setting. This bug is probably it.

I will reply again tomorrow after some experimentation.

@tdrews tdrews closed this as completed in 150fdd4 Aug 26, 2015
@Feenposhleen
Copy link
Author

Okay, so the issue is confirmed for our use case. Changing the encoders to deliver 12s minBufferTime solved it. Thanks a lot!

I'm gonna sneak in another question while I'm at it; what is the easiest way to modify the "safety padding" that Shaka applies to the live edge?

@tdrews
Copy link
Contributor

tdrews commented Aug 27, 2015

Glad you were able to solve the issue. The master branch also includes a fix, which will be part of the v1.5.0 release.

I'm gonna sneak in another question while I'm at it; what is the easiest way to modify the "safety padding" that Shaka applies to the live edge?

So, we compute the stream start time differently depending on the MPD style,

However, for both MPD styles the VideoSource offsets the stream start time by @minBufferTime so the streams can buffer at least that amount of content... this is probably why you are seeing a large offset from the live-edge.

tl;dr; I suggest you use a larger streamBufferSize (see Player.configure) with a smaller @minBufferTime, this will reduce your offset from the live-edge at startup (and reduce startup latency) whilst also ensuring a large buffer during playback.

@joeyparrish
Copy link
Member

minBufferTime is defined by the DASH spec as the time that must be buffered before playback begins in order to achieve no-rebuffer playback with the bandwidths specified in the manifest. So not only do we wait until minBufferTime to start up, it's not feasible to stream all the way to the live edge without accounting for minBufferTime.

streamBufferSize, on the other hand, defines how much data has to be in buffer before we stop fetching segments. It's the buffering goal during playback, so it makes sense to have this larger than minBufferTime.

Since you want low latency startup, you use small minBufferTime. Since you want to get ahead of the game to avoid transient network slowdowns, you use a larger streamBufferSize.

For live streams at the edge, when streamBufferSize is larger than minBufferTime, you won't ever be able to get a full streamBufferSize of data in buffer (because it's not available yet). But this setting will have an effect when you rewind and watch from behind the live edge.

@Feenposhleen
Copy link
Author

Awesome responses. Very helpful. Thanks again!
Also major bonus points for RFC-esque ASCII diagrams in the source comments. =)

@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

5 participants