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

TTML PNG image captions scaled differently due to regions straddling segment boundaries #4839

Closed
david-hm-morgan opened this issue Dec 14, 2022 · 2 comments · Fixed by #4841
Assignees
Labels
component: captions/subtitles The issue involves captions or subtitles component: TTML The issue involves TTML subtitles specifically component: UI The issue involves the Shaka Player UI priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@david-hm-morgan
Copy link
Contributor

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

What link can we use to reproduce this?
https://v4-3-1-dot-shaka-player-demo.appspot.com/demo/#audiolang=en;textlang=sv;uilang=en;asset=https://otvplayer.nagra.com/demo/content/shakaPlayer/otvpl-3672/otvpl-3672-shorter.mpd;panel=CUSTOM%20CONTENT;build=uncompiled

What version of Shaka Player are you using?
v4.3.1-uncompiled

What browser and OS are you using?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

What did you do?

Play the stream
Enable captions.
If necessary scrub back and forth between 00:00:06:26 & 00:00:07:29
Pay attention to the size of the PNG subtitles.

What did you expect to happen?
Consistent size and no gap (absence) between the cues showing the same PNG for time range.

What actually happened?

Image shown scaled at different sizes during its time span.

Analysis so far:
Images that appear in more than one consecutive segment are defined in equivalent but differently labelled regions.
As time progresses the earlier version of the label will be replaced but may linger around in the DOM and hence affect scaling of images.

image

image

History: works well in 4.1.2 but has regressed since, 4.3.1 worsens as we seem gaps of no captions in the timeline.

@david-hm-morgan
Copy link
Contributor Author

I now understand the problem and why it regressed when it did.

Captions straddle the fixed segment boundary
one caption therefore has to be repeated in two boundaries
regions with size are allocated according to the number of lines of text in the image
6% for 1 line, 13% for two
in each segment the regions are defined freshly
but the ids of the regions are reused!
when segment 2's region 0 comes up to be rendered the code has assumed region 0 is the one it knows about already
image can appear wrongly sized
Before v4.1.3 the code separated regions uniquely and they were new every time and therefore correctly as requested.

In v4.1.3 a code change for dealing with regions regressed by letting what it believed were uniquely named regions linger for re-use.

image

@david-hm-morgan
Copy link
Contributor Author

I am working on a fix

@avelad avelad added type: bug Something isn't working correctly component: TTML The issue involves TTML subtitles specifically component: UI The issue involves the Shaka Player UI component: captions/subtitles The issue involves captions or subtitles priority: P2 Smaller impact or easy workaround labels Dec 15, 2022
@avelad avelad added this to the v4.4 milestone Dec 15, 2022
avelad pushed a commit that referenced this issue Dec 15, 2022
Captions split over stream segment boundaries are repeated over more
than one segment.
Regions in which they sit maybe described the same but allocated
different ids and vice versa.
Proposal to treat internal region ids uniqely by encoding the dimensions
in the id.

fixes #4839
joeyparrish pushed a commit that referenced this issue Jan 13, 2023
Captions split over stream segment boundaries are repeated over more
than one segment.
Regions in which they sit maybe described the same but allocated
different ids and vice versa.
Proposal to treat internal region ids uniqely by encoding the dimensions
in the id.

fixes #4839
joeyparrish pushed a commit that referenced this issue Jan 13, 2023
Captions split over stream segment boundaries are repeated over more
than one segment.
Regions in which they sit maybe described the same but allocated
different ids and vice versa.
Proposal to treat internal region ids uniqely by encoding the dimensions
in the id.

fixes #4839
joeyparrish pushed a commit that referenced this issue Jan 13, 2023
Captions split over stream segment boundaries are repeated over more
than one segment.
Regions in which they sit maybe described the same but allocated
different ids and vice versa.
Proposal to treat internal region ids uniqely by encoding the dimensions
in the id.

fixes #4839
joeyparrish pushed a commit that referenced this issue Jan 13, 2023
Captions split over stream segment boundaries are repeated over more
than one segment.
Regions in which they sit maybe described the same but allocated
different ids and vice versa.
Proposal to treat internal region ids uniqely by encoding the dimensions
in the id.

fixes #4839
Robloche pushed a commit to Robloche/shaka-player that referenced this issue Feb 8, 2023
Captions split over stream segment boundaries are repeated over more
than one segment.
Regions in which they sit maybe described the same but allocated
different ids and vice versa.
Proposal to treat internal region ids uniqely by encoding the dimensions
in the id.

fixes shaka-project#4839
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Feb 13, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2023
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: TTML The issue involves TTML subtitles specifically component: UI The issue involves the Shaka Player UI priority: P2 Smaller impact or easy workaround 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.

2 participants