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

Remain in buffering state until text is buffered #2710

Closed
interlark opened this issue Jul 3, 2020 · 8 comments
Closed

Remain in buffering state until text is buffered #2710

interlark opened this issue Jul 3, 2020 · 8 comments
Labels
component: captions/subtitles The issue involves captions or subtitles priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request

Comments

@interlark
Copy link

interlark commented Jul 3, 2020

Using hls streams, for example this shaka-demo, you can notice than on seek ts-segments and webvtt-segments don't get loaded evenly.
image

Expected:

fileSequence64.ts
fileSequence64.webvtt
fileSequence65.ts
fileSequence65.webvtt

or

fileSequence64.webvtt
fileSequence64.ts
fileSequence65.webvtt
fileSequence65.ts

That's why sometimes when you seek your hls-streams you could catch your videos without subtitles for a while.

@TheModMaker
Copy link
Contributor

I notice the TS segments are grey, so the browser is probably caching the segments, so they get downloaded immediately. Since the first TS segment is downloaded quickly, we fetch the second soon. We don't have any scheduling for segments, we just download segments in order as quickly as we can. We also play the video once audio+video is downloaded, so we'll start playing even if we don't have the text available.

@interlark
Copy link
Author

How can I avoid playing without vtt segment? Like add subtitles as required as audio+video.

@michellezhuogg michellezhuogg added type: question A question from the community and removed needs triage labels Jul 7, 2020
@interlark
Copy link
Author

I think it's sorta bug, because if text track is enabled and selected, then player ought to wait for a text fragment as well as audio and video.

@joeyparrish
Copy link
Member

This doesn't appear to be a bug to me. We have logic that no stream should be more than 1 segment ahead of any other, and that restriction appears to be working. Your audio doesn't get 10 segments ahead of your video (as it used to once upon a time in an old version of Shaka Player). The same is true for text.

The buffering of media (pausing until more is loaded) is done at the level of the media element (<video> or <audio> tag in the HTML). This does not include text, which is handled separately.

Text does not need to be fetched ahead of audio or video being fetched, it only needs to be processed ahead of audio or video being played. It's possible that your buffering goal (what is fetched ahead of playback) is really close to your segment size. We can't tell what your segment size is, but 10s is surprisingly common still, and that's also our default buffering goal in current versions of Shaka Player.

Therefore I would recommend you increase the buffering goal of the player so that what is fetched and processed is further ahead of what is being played. Try this:

player.configure('streaming.bufferingGoal', 20);

If that doesn't work, try increasing it to 30.

Does this help?

@interlark
Copy link
Author

Parameter bufferingGoal could help with playing without seeks, when you seek a stream (or walk through specific time points), the player doesn't wait for subtitles and start playing without them. That's why you could miss one vtt-cue if it has relatively heavy size or short duration (which could disturb hear-impaired persons), currently the only way of walk-around the problem is rewind a little back the stream to re-watch it with already downloaded text segment.

@TheModMaker
Copy link
Contributor

I think it's reasonable to change our buffering logic to also wait for text tracks. We currently manually enter a buffering state when we don't have enough data and only move forward when we have buffered streaming.rebufferingGoal amount of content. We could extend this logic to apply to text too. If the user has enabled text tracks, it's because they may need it so it should be the same priority as audio.

@TheModMaker TheModMaker added type: enhancement New feature or request and removed type: question A question from the community labels Aug 5, 2020
@TheModMaker TheModMaker added this to the Backlog milestone Aug 5, 2020
@TheModMaker TheModMaker changed the title [HLS] VTT segments order Remain in buffering state until text is buffered Aug 5, 2020
@theodab theodab added component: captions/subtitles The issue involves captions or subtitles priority: P3 Useful but not urgent labels Sep 30, 2021
@avelad
Copy link
Member

avelad commented Apr 16, 2024

Is anyone interested in seeing this implemented? Otherwise the issue will be closed in 7 days.

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Apr 16, 2024
@shaka-bot
Copy link
Collaborator

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Apr 23, 2024
@avelad avelad removed this from the Backlog milestone Apr 30, 2024
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Jun 22, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Jun 22, 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 priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants