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 text segment timestamp issues #1563

Closed
joeyparrish opened this issue Aug 28, 2018 · 7 comments
Closed

HLS text segment timestamp issues #1563

joeyparrish opened this issue Aug 28, 2018 · 7 comments
Assignees
Labels
component: HLS The issue involves Apple's HLS manifest format status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@joeyparrish
Copy link
Member

When we fetch segments in the HLS parser to extract their timestamps, we fail if that process fails. This means that empty text segments cause a playback failure.

Furthermore, if the text segment is not empty, we still handle it wrong in many cases. We extract the start time of the first cue, which is not the same as the start time of the first segment. If the first cue is at time 2, we expect that this is the starting time of the segment itself.

When we then treat the timestamps as segment-relative, we add the segment start time to all cue times, which causes them to be delayed more and more as time goes on. In the HLS version of "Angel One", you can see the cues spreading out subtly over the 60-second clip. In Axinom's HLS live stream, you won't see cues at all, since the timestamps are already large enough for this skew to be extreme.

In HLS, we can usually expect that the X-TIMESTAMP-MAP header is present, which will give us a clue as to the segment start time. When this header is missing, the HLS spec says we should treat it as being present with a mapping of 0 to 0.

We should use this mapping-based offset as the first text segment's start time. This will solve the playback failure on empty segments. We should also stop treating HLS-based VTT as segment-relative.

(Related to #1558)

@joeyparrish joeyparrish added type: bug Something isn't working correctly component: HLS The issue involves Apple's HLS manifest format labels Aug 28, 2018
@shaka-bot shaka-bot added this to the v2.5 milestone Aug 28, 2018
@kqyang
Copy link
Contributor

kqyang commented Aug 28, 2018

We should use this mapping-based offset as the first text segment's start time.

The media segment may not start from 0. Do you mean to use the offset + the earliest media segment start time as the first text segment's start time?

@ChristiaanScheermeijer
Copy link

ChristiaanScheermeijer commented Nov 15, 2018

Hi @joeyparrish,

Is the following issue also being caused by the problem you are describing?

https://shaka-player-demo.appspot.com/demo/#asset=https://dutchchannels.nl/demo/videodock/hls/Manifest.m3u8;lang=nl-NL;build=uncompiled

  • HLS playback starts at the same position as the first VTT cue (you can't seek before that position).
  • The same "offset" is being used for the VTT rendering. So all cues are delayed by the startTime of the first cue.

We are having this issue in the Chromecast receiver. The test stream from above is an extracted from Axinom.

The first issue seems to be resolved in the master branch though.

@ChristiaanScheermeijer
Copy link

A workaround for this issue:

By adding a placeholder cue in the WebVTT file at 0 seconds, the offset issue seems to be fixed.

WEBVTT

00:00:00.000 --> 00:00:00.010
...

@joeyparrish
Copy link
Member Author

@ChristiaanScheermeijer, yes, I believe that is the same issue.

@joeyparrish joeyparrish modified the milestones: v2.5, v2.6 Feb 21, 2019
@Romain-Bernier
Copy link

I have an issue of synchronization between the subtitles and the video in the following media on the shaka demo page : https://mpdsample.s3.amazonaws.com/SHARE/vtt_singleoutput_hls/master.m3u8
I believe it's the same issue, correct me if I'm wrong.
Any update on a upcoming fix ?
Thanks

@joeyparrish
Copy link
Member Author

@Romain-Bernier, it's probably the same issue. I don't have an ETA on a fix yet, but hopefully, we will find time to address this for v2.6.

@joeyparrish
Copy link
Member Author

Starting now on the nightly build, we will no longer parse text segments to get timestamps. Please re-check your content on the nightly and let us know if you have any further issues. Thanks!

@shaka-project shaka-project locked and limited conversation to collaborators Nov 29, 2019
@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
component: HLS The issue involves Apple's HLS manifest format 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

6 participants