Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new decoder for
.ass
subtitles to fix this issue: google/ExoPlayer#8435It also partially fixes the following issue: #691
It is currently a draft because the following issues still need to be addressed:
.ass
subtitles muxed in MKV files. It would also needs to support "raw" .ass file.AssRenderer
is added inSubtitleTranscodingTrackOutput.java
andDefaultRenderersFactory.java
is hacky.draw_ass_rgba
is too slow for 4K (3840x2160) bitmaps where the subtitle completely covers the screen. Neon optimization is needed (or maybe openmp?).Note: We are no longer working on this PR. If anyone wants to use it as a base, feel free to improve it and open a non-draft PR.
Why should Media3 provide a native decoder using libass?
It’s practically impossible to replicate libass behavior accurately.
The first commit that introduced SSA/ASS subtitle support in Media3 is this one, made in 2017 — that was 8 years ago, and Media3 still lacks support for many elements of the ASS/SSA spec.
Here's a screenshot showing the video with and without subtitles. Implementing this in SsaParser.java is far from trivial.


Also, here’s a video that contains a
.ass
subtitle (hardsubbed). The subtitle is the text: "CIBLE DE LA QUÊTE".https://github.com/user-attachments/assets/af2b54b5-baf8-41d9-bc05-f97702757402
Again, implementing all the feature in java needed just to display the subtitle accuratly is basically impossible.
Finally, note that this PR is the work of Raphael Dupuis, Sonny Uplavan, Vincent Zauhar and me.