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

Fix: Subtitle Track Playhead is dependant Of Video Track #302

Merged
merged 8 commits into from
Nov 21, 2023

Conversation

Nfrederiksen
Copy link
Collaborator

@Nfrederiksen Nfrederiksen commented Nov 21, 2023

The Playhead speed for the different tracks in the CE is different for video tracks and audio tracks. However, subtitle tracks were initially assumed to always have segments of durations equal to their video segment counterparts, so the playhead speed for subtitle tracks would just follow the one for video. This does not work that well if the subtitle track segments are different from video track segments. The media sequence for subtitles would lag behind. Subtitle segments would get out of sync with video.

This PR solves this issue by using an updated version of @eyevinn/hls-vodtolive where the "deltaTimesSubtitle" list now contains more accurate values. Making it possible for subtitle tracks to have an independent playhead speed. The media sequence for subtitles should now 'fast-forward' when needed in order to have the content positions for Video, Audio, and Subtitles aligned. (audio and subtitle positions are allowed to be ahead of video, but never more than a segment duraiton)

New debug logging is added too, so that it is clear where the tracks are position wise.

@Nfrederiksen Nfrederiksen force-pushed the fix/independent-subtitle-playhead branch from 080106c to a4f9f7b Compare November 21, 2023 12:27
@Nfrederiksen Nfrederiksen marked this pull request as ready for review November 21, 2023 12:29
@Nfrederiksen Nfrederiksen changed the title Fix/independent subtitle playhead Fix: Subtitle Track Playhead is Not Independant Of Video Track Nov 21, 2023
@Nfrederiksen Nfrederiksen changed the title Fix: Subtitle Track Playhead is Not Independant Of Video Track Fix: Subtitle Track Playhead is dependant Of Video Track Nov 21, 2023
@Nfrederiksen Nfrederiksen added the enhancement New feature or request label Nov 21, 2023
Copy link
Contributor

@birme birme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nfrederiksen Nfrederiksen merged commit c94b072 into master Nov 21, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants