Skip to content

Comments

Integrated libass-android to enable advanced subtitle rendering#5397

Draft
j3553a wants to merge 1 commit intojellyfin:masterfrom
j3553a:libass-reimplementation
Draft

Integrated libass-android to enable advanced subtitle rendering#5397
j3553a wants to merge 1 commit intojellyfin:masterfrom
j3553a:libass-reimplementation

Conversation

@j3553a
Copy link

@j3553a j3553a commented Feb 7, 2026

This commit integrates the libass-android library to enable advanced subtitle rendering (e.g., for ASS/SSA formats).

Key changes include:

  • A new developer setting to enable/disable libass.
  • Configurable options for libass glyph and cache size.
  • Integration of libass into the ExoPlayer backend for both the TV app and the unified playback module.

Inspired by changes initially created by nielsvanvelzen

Fixes #4728

This commit integrates the `libass-android` library to enable advanced subtitle rendering (e.g., for ASS/SSA formats).

Key changes include:
- A new developer setting to enable/disable libass.
- Configurable options for libass glyph and cache size.
- Integration of libass into the ExoPlayer backend for both the TV app and the unified playback module.

Inspired by changes initially created by nielsvanvelzen
@j3553a j3553a marked this pull request as draft February 7, 2026 04:27
@j3553a
Copy link
Author

j3553a commented Feb 7, 2026

Good evening,

Apologies if I missed any contributing rules. I was hoping to receive feedback on these changes to integrate libass back into Jellyfin Android TV. I reused most of your initial implementation but added some settings in the developer options.

@crobibero
Copy link
Member

How is this PR different from the existing PR?

#5121

@j3553a
Copy link
Author

j3553a commented Feb 7, 2026

How is this PR different from the existing PR?

#5121

This PR is largely the same implementation with the addition of a configurable cache. There are now settings to allow adjusting the glyph and cache.

Under the developer options you can enable the library:

image ****

and configure the glyph size and cache size.

image

Previous iterations of libass-android didn't allow you to configure the cache and glyph size but I recently made a change there to make it configurable and have found that increasing the glyph size to 10,000 and the cache size to 128 MB made everything substantially more stable. I was able to test these settings for months and was very happy with the changes.

If you're interested you can find the changes to make the caching configurable in libass-android here.

@nielsvanvelzen
Copy link
Member

There are no plans to add configurable options for the gylph/cache sizes, otherwise this seems like a duplicate of #5121 which is waiting for a stable release of the library to be merged.

@j3553a
Copy link
Author

j3553a commented Feb 7, 2026

That’s understandable. Even without exposing these values as user configurable, I’d still recommend altering the defaults used by libass-android.

The upstream libass C library defaults to a glyph cache size of 10,000 and a cache size of 128 MB. In contrast, libass-android currently defaults the glyph cache to 1,024, which I’ve found to be unstable on an Nvidia Shield.

In testing on an Nvidia Shield, increasing the glyph cache to 10,000 (while keeping the cache size at 128 MB) significantly improved stability. Based on this, I believe users would have a noticeably better experience if Jellyfin adopted these values as defaults, even if the settings themselves are not exposed in the UI.

I appreciate your time and feedback. Please let me know if you'd prefer I close this PR.

@nielsvanvelzen
Copy link
Member

I’d still recommend altering the defaults used by libass-android.

Preferably we should update the defaults upstream (@peerless2012 are you open for that?), but we can ofc change them in the client as well. With my own testing (also on a shield) I haven't found any stability issues since we switched to the OpenGL overlay, which you don't seem to be using in this PR.

@peerless2012
Copy link

I’d still recommend altering the defaults used by libass-android.

Preferably we should update the defaults upstream (@peerless2012 are you open for that?), but we can ofc change them in the client as well. With my own testing (also on a shield) I haven't found any stability issues since we switched to the OpenGL overlay, which you don't seem to be using in this PR.

I think it is open, if there is a good enough default config, I can use it as default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Libass Experimental Feature - Playback Slows Down and Freezes When Processing Karaoke Styled Subtitles

4 participants