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

Can't play at the live edge #636

Closed
ErvinGegner opened this issue Dec 24, 2016 · 8 comments
Closed

Can't play at the live edge #636

ErvinGegner opened this issue Dec 24, 2016 · 8 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@ErvinGegner
Copy link

  • What version of Shaka Player are you using?
    2.0.2

  • Can you reproduce the issue with our latest release version?
    Yes

  • Can you reproduce the issue with the latest code from master?
    Yes

  • Are you using the demo app or your own custom app?
    Custom app

  • If custom app, can you reproduce the issue using our demo app?
    Yes

  • If custom asset, what manifest and license server URIs?
    http://w9nnd57mi5zm5.cloud.elementaltechnologies.com/out/u/live-dash.mpd

  • What did you expect to happen?
    Only one video resolution to be preloaded

  • What actually happened?
    All available video resolutions were preloaded, producing a delay of approximately 15 seconds between manifest load finish and actual video start.

Hi everyone, just to add more info I'll say that the situation is the following:
I'm loading mentioned manifest which has 3 different resolutions available (960px, 640px, 480px).
By the looks of it(in network tab) all 3 resolutions are preloaded and buffered and then only one is actually played.
Is there a way to configure desired resolution before/during manifest load? Just to avoid the loading delay or is it something wrong in the manifest itself?

Thanks guys

@joeyparrish joeyparrish self-assigned this Dec 27, 2016
@joeyparrish joeyparrish added type: question A question from the community and removed type: question A question from the community labels Dec 27, 2016
@joeyparrish
Copy link
Member

@ErvinGegner, we don't buffer all resolutions at once. We load the initialization segments of all resolutions so that we can make zero-latency adaptation decisions later. For this content, init segments are between 638 and 733 bytes each. In total, we loaded 2738 bytes of initialization segments in 4 HTTP requests. On my internet connection here at work, this took a total of 377ms.

I noticed that playback took a while to get started, though. Now that it's playing, it's hovering around 31 seconds behind the live edge (-0:31 in the video controls). I jumped to the live edge by clicking on the timecode, but it eventually had to buffer and fall back to -0:04 and again to -0:06.

For some reason, we are unable to play at the live edge. I checked for clock sync issues and found none. I see that the manifest uses minimumUpdatePeriod of 30s, suggestedPresentationDelay of 25s, and minBufferTime of 30s. These don't seem crazy off-hand, so it should work.

We will investigate further.

@joeyparrish joeyparrish changed the title Choosing video resolution before manifest load Can't play at the live edge Dec 27, 2016
@joeyparrish joeyparrish added this to the v2.1.0 milestone Dec 27, 2016
@ErvinGegner
Copy link
Author

Great, thank you for the reply, looking forward to 2.1.0

@joeyparrish joeyparrish added the type: bug Something isn't working correctly label Dec 28, 2016
@joeyparrish
Copy link
Member

I found the source of the problem. The Playhead class decides whether we are in a buffering state or not. However, it doesn't account for the live edge, beyond which we can't buffer. This calculation only works for VOD:

var duration = this.video_.duration - fudgeFactor;
var atEnd = (bufferEnd >= duration) || (this.video_.ended);

@joeyparrish
Copy link
Member

Separate from the bug in our code, there also seem to be some slight problems with the parameters of your manifest. Even after we have fixed our bug, you should make some changes to improve the performance of your stream.

With a presentation delay of 25s, updating the manifest only every 30s means we do still occasionally underrun. You should make the delay slightly larger than the update period. Either 35s suggestedPresentationDelay and 30s minimumUpdatePeriod or 25s delay and 20s update should do the trick.

Also, you have a minBufferTime of 30s, which is pretty high. We have to make an exception for the live edge, but this parameter is the minimum amount of content that must be buffered before a player starts playback. If the user were to seek backward in the stream, say, 45s, the player would have to buffer 30s ahead before it could play again. This should be reduced to something like 3s or 6s (1 or 2 segments).

@joeyparrish
Copy link
Member

We've just pushed a fix for the bug in our code. This should make things much better. You can see the fixed code in the master branch and in our nightly build.

I still recommend some changes to your minBufferTime and to either presentationDelay or minimumUpdatePeriod as outlined above. Please let me know if there's anything else I can do for you.

@ErvinGegner
Copy link
Author

@joeyparrish Wonderful I think you've done everything you could on your side so now its my turn to apply configurations as you've recommended.
Thank you for quick response and the overall assistance.

@joeyparrish
Copy link
Member

No problem. We are always happy to help.

joeyparrish added a commit that referenced this issue Jan 7, 2017
We can't buffer past the live edge, so we must account for the live
edge in buffering state calculations.

Closes #636

Change-Id: I099e68291786a462dfb63471a2eb9974643e75bd
@joeyparrish
Copy link
Member

The fix for this has just been released in v2.0.3.

@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