-
Notifications
You must be signed in to change notification settings - Fork 6k
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
SSA/ASS subtitles - Overlapping start/end times and position tag is not handled #6320
Comments
I had a quick look at the library and from what I see it produces overlay images including the subtitles. Is that correct? I'm afraid that's not that easy to support in ExoPlayer, because you'd need some form of special renderer that draws the overlay. See #5860 for details around writing such a renderer. It would also require an extra surface and at least some extra layer in the UI module to actually draw the overlay. Depending on how it looks like, we could probably accept pull requests for an extension that integrates this library and provides the necessary integration layers. But we should definitely keep the basic text-only subtitle extraction for SSA/ASS we currently have. The problem you are describing sounds more like a bug in our implementation and it would be great if you can provide example media and some guidance on the expected result, so that we can fix our support for the text-only version. |
The particular reasons why this goes wrong here are:
Step 1 is more important to remove the strange flickering of subtitles. Step 2 is nice to have because it would actually render the text at the right position. |
Note: I think (1) is a duplicate of #4725. Should we merge that issue and this one (carrying over any necessary information into whichever issue is kept open)? |
This comment has been minimized.
This comment has been minimized.
Let's keep this issue as it is newer and has more details. Another example ass file content is in #4725 (comment). |
I'd like to contribute on this if it's ok. I've already parsed and applied the position attributes, commit: Regarding the overlapping issue, I am not sure what change is needed, a hint would be great. I was thinking about changing |
|
Let's say we have overlapping subtitles like this: cueTimes will be [4000000, 7000000, 5000000, 8000000] The first problem is that currently the I assume the decoder needs to be changed to build overlapping parts as different cueTimes? Or do you think this can be solved without touching the |
The cues for your example should be: If you send the data in this format, the TextRender should be happy I think. |
Following the approach you described it seems to be working fine. I've created a pull request to make it easier to show the diffs. What do you think about the proposed solution? It can be optimized? |
Thanks for updating the pull request! @icbaker will have a look at the details I think. |
PR is merged |
Use case description
When playing videos files with SSA/ASS subtitle tracks, styled subtitles are mashed together with conversation. For example, many animated Japanese television shows have subtitles that float on screen to translate things that aren't part of speech. In ExoPlayer, this results in the subtitles flipping back and forth between conversation and the translated symbols. This leads to neither being on screen long enough to be read.
Proposed solution
Integrate libass as a supported subtitle renderer
Alternatives considered
The only alternative would be rolling a new renderer from scratch for ExoPlayer. All major media players are currently using this library. I did look through other issues on this project about SSA/ASS subtitles, but none of them lead to a request for integrating this library as a solution.
The text was updated successfully, but these errors were encountered: