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

Full ASS support #6943

Closed
zoriya opened this issue Jul 1, 2024 · 5 comments · Fixed by #6975
Closed

Full ASS support #6943

zoriya opened this issue Jul 1, 2024 · 5 comments · Fixed by #6975
Assignees
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
Milestone

Comments

@zoriya
Copy link

zoriya commented Jul 1, 2024

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

Is your feature request related to a problem? Please describe.

The current ASS subtitles support extract texts but does not respect the styling at 100%. We can't create a plugin to handle this since subtitles are all treated in two steps (first extract to Shaka's internal cue and then display via a renderer).

Describe the solution you'd like

It would be great to display ASS subtitle with all their styles, using libass directly. This can be done using https://github.com/ThaUnknown/jassub for example.

Since it's an external library and for a niche case, I'd understand not including this by default, but It would be nice to have a plugin for that. I'm willing to write such a plugin, but I think I'm mission some tools to do so (namely hijack the text parsing->render pipeline).

Describe alternatives you've considered

Not using Shaka for ass subtitles and make edge cases on our code. This can be fine if this is too difficult to implement.

Are you planning send a PR to add it?

I'm planning to write a plugin for that, but I won't be sending PRs to add plugin APIs.

@zoriya zoriya added the type: enhancement New feature or request label Jul 1, 2024
@avelad
Copy link
Member

avelad commented Jul 1, 2024

It is the first time that in 3 years someone has been interested in ASS Text Parser!

Please send examples of the styles that are not supported or at least tell us that styles according to the SPEC (http://moodub.free.fr/video/ass-specs.doc)

Thank you!

@avelad avelad added component: captions/subtitles The issue involves captions or subtitles status: waiting on response Waiting on a response from the reporter(s) of the issue labels Jul 1, 2024
@shaka-bot shaka-bot added this to the Backlog milestone Jul 1, 2024
@zoriya
Copy link
Author

zoriya commented Jul 1, 2024

In my tests, the subtitle did not work at all (nothing showing). I tested with https://thaunknown.github.io/jassub/subtitles/FGOBD.ass

Shaka also lacks the ability to add fonts, so if the subtitle wants to use a weird font not available on the device it will fallback to a default font.

The more I talk about this, the more I realize It would be way easier to simply use jassub on top of the shaka instead of trying to combine the two. Sorry for then noise, I think we can close this.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jul 1, 2024
@avelad
Copy link
Member

avelad commented Jul 1, 2024

I have found a error in the parser, I will create a PR to fix it. You are right about the font, I will investigate about it. On the other hand I have found a error that we show duplicate subtitles, I will also create a PR to fix it!

@avelad
Copy link
Member

avelad commented Jul 1, 2024

@zoriya To load a font you can use https://developer.mozilla.org/en-US/docs/Web/API/CSS_Font_Loading_API, it is not necessary for Shaka to know the fonts, you can load them on your website independently of Shaka.

@avelad
Copy link
Member

avelad commented Jul 2, 2024

I'm going to make a PR to support DVB fonts in DASH, so I'll take the opportunity to make a new public method called addFont and this will help you!

@avelad avelad modified the milestones: Backlog, v4.11 Jul 2, 2024
@avelad avelad added the priority: P3 Useful but not urgent label Jul 3, 2024
@avelad avelad self-assigned this Jul 3, 2024
@avelad avelad closed this as completed in afc3e59 Jul 3, 2024
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Sep 1, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Sep 1, 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

Successfully merging a pull request may close this issue.

3 participants