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

HLS stops showing webvtt subtitle after timestamp jumping back even with #EXT-X-DISCONTINUITY #6325

Closed
chihchianglu-google opened this issue Mar 6, 2024 · 0 comments · Fixed by #6388
Assignees
Labels
component: captions/subtitles The issue involves captions or subtitles component: HLS The issue involves Apple's HLS manifest format component: WebVTT The issue involves WebVTT subtitles specifically priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@chihchianglu-google
Copy link

Have you read the FAQ and checked for duplicate open issues?
Yes.

If the problem is related to FairPlay, have you read the tutorial?
Note related to FairPlay.

What version of Shaka Player are you using?
All v4 players (demo pages) stops displaying subtitle after timestamp jumping back with #EXT-X-DISCONTINUITY, however, all v3 are working as expected (v3.3.19 for instance).

Can you reproduce the issue with our latest release version?
Yes, v4.7.11 is the latest build / version as of 3/5/2024.

Can you reproduce the issue with the latest code from main?
Yes, I tried it on nightly build page (which should be the main).

Are you using the demo app or your own custom app?
I try it on demo page, nightly build page, and old releases, all v3s and v4s

If custom app, can you reproduce the issue using our demo app?
Not custom app.

What browser and OS are you using?
Chrome on MacOS 14.3.1 (23D60)

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
Not on embedded devices.

What are the manifest and license server URIs?
HLS + FMP4: link
HLS + TS: link
DASH + FMP4: link

What configuration are you using? What is the output of player.getConfiguration()?
Simply paste the manifest links on shaka player demo page w/o changing any configuration.

What did you do?
Paste the HLS manifest links to shaka player demo page, and starting from ~2:20 seconds, the stream timestamp jumps back with #EXT-X-DISCONTINUITY tag properly inserted on all media playlists. However, webvtt subtitles stop showing after that (All v3 shaka demo pages are working, and all v4 shaka demo pages are not working. Safari native player also works).

What did you expect to happen?
Subtitles keeps showing throughout the whole stream w/o issues.

What actually happened?
For livestream use case, broadcasters might broadcast 2 different input streams and the media timestamps of each could start from 0.
In such case, for HLS, we insert #EXT-X-DISCONTINUITY on all media playlists, and expect players to handle that properly.

I created the manifests above with the scenario I just mentioned. Shaka player stops showing webvtt subtitles after the timestamp jump back (~2:20 seconds in the manifests provided above).
I realize all the v3 demo pages are working as expected, meaning the player shows subtitles throughout the whole stream, however, all the v4 demo pages stop showing subtitles after 2:20 seconds. The symptom looks like a regression.

DASH works as expected w/o issues (for DASH, we create a separate period when timestamp jumpback, just fyi).

Let me know if you need any further information, thanks.

@chihchianglu-google chihchianglu-google added the type: bug Something isn't working correctly label Mar 6, 2024
@shaka-bot shaka-bot added this to the v5.0 milestone Mar 6, 2024
@joeyparrish joeyparrish added component: HLS The issue involves Apple's HLS manifest format component: captions/subtitles The issue involves captions or subtitles priority: P1 Big impact or workaround impractical; resolve before feature release component: WebVTT The issue involves WebVTT subtitles specifically labels Mar 12, 2024
@joeyparrish joeyparrish self-assigned this Mar 12, 2024
@theodab theodab closed this as completed in 966302d Apr 4, 2024
avelad pushed a commit that referenced this issue Apr 8, 2024
Fixes #5168
Fixes #6325
Fixes #5096
Fixes #4828
Fixes #5604

- Currently the offset used for `time.periodStart` in [computeHlsSequenceModeOffset_](https://github.com/shaka-project/shaka-player/blob/03bb463a724483c88df818b11c807a0fdc11cccb/lib/text/vtt_text_parser.js#L174), is calculated and set at stream start and never updated.
- In `MediaSourceEngine` the correct offset is actually being calculated on every call to `appendBuffer`. But when it is applied to the text engine `textEngine_.setTimestampOffset`, in order to update `time.periodStart`,  it only ever uses the initial calculated offset.
- `this.textSequenceModeOffset_` is initiated as a `shaka.util.PublicPromise()`. The value is updated by calling `this.textSequenceModeOffset_.resolve(value)`. However, once the promise is resolved, calling resolve on it again has no effect. So the first value passed is locked in and used in all subsequent calculations.
- This PR resets `this.textSequenceModeOffset_` to a new `shaka.util.PublicPromise()` after it's previously fulfilled value has been read.

Co-authored-by: Casey Occhialini <1508707+littlespex@users.noreply.github.com>
avelad pushed a commit that referenced this issue Apr 8, 2024
Fixes #5168
Fixes #6325
Fixes #5096
Fixes #4828
Fixes #5604

- Currently the offset used for `time.periodStart` in [computeHlsSequenceModeOffset_](https://github.com/shaka-project/shaka-player/blob/03bb463a724483c88df818b11c807a0fdc11cccb/lib/text/vtt_text_parser.js#L174), is calculated and set at stream start and never updated.
- In `MediaSourceEngine` the correct offset is actually being calculated on every call to `appendBuffer`. But when it is applied to the text engine `textEngine_.setTimestampOffset`, in order to update `time.periodStart`,  it only ever uses the initial calculated offset.
- `this.textSequenceModeOffset_` is initiated as a `shaka.util.PublicPromise()`. The value is updated by calling `this.textSequenceModeOffset_.resolve(value)`. However, once the promise is resolved, calling resolve on it again has no effect. So the first value passed is locked in and used in all subsequent calculations.
- This PR resets `this.textSequenceModeOffset_` to a new `shaka.util.PublicPromise()` after it's previously fulfilled value has been read.

Co-authored-by: Casey Occhialini <1508707+littlespex@users.noreply.github.com>
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Jun 3, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: captions/subtitles The issue involves captions or subtitles component: HLS The issue involves Apple's HLS manifest format component: WebVTT The issue involves WebVTT subtitles specifically priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants