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

Frame dropped at multi-period boundary due to inaccurate Period@duration #368

Closed
kqyang opened this issue Apr 3, 2018 · 1 comment
Closed
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@kqyang
Copy link
Contributor

kqyang commented Apr 3, 2018

System info

Operating System: Debian 4.9.65
Shaka Packager Version: v2.0.2 with changes
Chrome Version: v65.0.3325.181
Player Version: Shaka Player v2.3.5

Issue and steps to reproduce the problem

Packager Command:
./packager ... --ad_cues '10;29;300'

Extra steps to reproduce the problem?
(1) Play the generated manifest (https://storage.googleapis.com/wvtemp/kqyang/ads4/out.mpd) in Shaka Player

What is the expected result?

Play smoothly.

What happens instead?

Seeing intermittent stalls at multi-period boundary, e.g. at ~12 seconds, ~30 seconds etc.

MPD:

<Period id="0" duration="PT12.0833S">    
...
</Period>

Observation on Chrome with additional debugging:

[46055:46055:0330/105840.808696:INFO:frame_processor.cc(861)] Dropping frame that is outside append window. pts 12041666, 12083332 append_window 0,12083300

[46055:46055:0330/105853.795328:INFO:frame_processor.cc(861)] Dropping frame that is outside append window. pts 30041714, 30083380 append_window 11983300,30083300

Clearly there is a rounding error in Chrome causing the frame to be dropped, which causes a gap in buffered range. This in turn leads to playback stalls (not sure why yet).

Chrome internally uses time accurate to microseconds, which is required by MSE spec. To avoid rounding errors like this in browsers, we should generate Period@duration with better than microseconds accuracy.

This problem can also be workarounded in player by having a fudge factor in appendWindowEnd, like what Shaka Player already does in appendWindowStart.

@kqyang kqyang added the type: bug Something isn't working correctly label Apr 3, 2018
@kqyang kqyang added this to the v2.1 milestone Apr 3, 2018
shaka-bot pushed a commit that referenced this issue Apr 13, 2018
This flag was introduced to workaround a rounding error in Chrome
(probably in other browsers too).

Also although this flag avoids the first frame of a Period to be
dropped due to rounding error but it could cause the last frame of a
Period to be dropped.

Now that we use a high precision Period@duration, we do not expect to
see rounding errors any more. The player would be a better place for
the workaround even if it is still needed.

Related issue: #368.

Change-Id: I3bd517ecc6d548ff62e0c13394edb49d4bc68e8f
@kqyang kqyang self-assigned this Apr 13, 2018
kqyang added a commit that referenced this issue Apr 20, 2018
Chrome internally uses time accurate to microseconds, which is
implemented per MSE spec (https://www.w3.org/TR/media-source/).

Generate Period@duration with better precision to avoid possible
buffered range gaps in Chrome (possibly other browsers too), which
may lead to other problems like playback stall.

b/74238961
Fixes #368.

Change-Id: I357a0f62b67f75c7ca044bb99ea4e3c8bbb6fecd
kqyang added a commit that referenced this issue Apr 20, 2018
This flag was introduced to workaround a rounding error in Chrome
(probably in other browsers too).

Also although this flag avoids the first frame of a Period to be
dropped due to rounding error but it could cause the last frame of a
Period to be dropped.

Now that we use a high precision Period@duration, we do not expect to
see rounding errors any more. The player would be a better place for
the workaround even if it is still needed.

Related issue: #368.

Change-Id: I3bd517ecc6d548ff62e0c13394edb49d4bc68e8f
@kqyang
Copy link
Contributor Author

kqyang commented Apr 20, 2018

Cherry-picked for v2.0.3.

@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Jun 2, 2018
@shaka-project shaka-project locked and limited conversation to collaborators Jun 2, 2018
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

2 participants