jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.86k stars 488 forks source link

Add support for external fonts in case of external ASS/SSA subtitle streams #3854

Closed pushrbx closed 3 months ago

pushrbx commented 3 months ago

Describe the feature you'd like

Recently the PR https://github.com/jellyfin/jellyfin-androidtv/pull/3663 removed the ability to change between players before starting the playback. I used this feature to select a different player (MXPlayer) for those videos where there was an ASS/SSA subtitle with custom fonts in the styles, but those fonts not embedded in the ASS/SSA file. With the external player I could just copy the font files on the TV, and tell the player the folder I've put them in, and it would render the subtitles correctly. However MXPlayer can't handle spdif passthrough for my TV, so I need to change to the default player for those videos, where I know there is multi channel audio. I'd like to have both without the hassle. For this edge case the the player selector was great, but the fundamental problem is the lack of font support in the default player for those ass subtitles where the font is not embedded.

So here I am asking you to add support for external fonts in case of the default player, so people like me are not forced to switch players / toggle the external player toggle. I'd like to keep this a bit open ended, however here is an idea for starter without knowing how complicated would it be to implement:

An option to specify where to load the fonts from if they are not found locally. (probably it would cause issues for those using external player, and it requires file reading permissions :disappointed: )

nielsvanvelzen commented 3 months ago

The app does not currently support SSA so I'm not sure what you're requesting. The Jellyfin server requires access to the fonts so it can use them to bake-in the subtitles.

pushrbx commented 3 months ago

@nielsvanvelzen To be more accurate I was referring to the separate .ass files which are transmitted as a stream to the player. And the player displays them in the menu as "External":

ExoPlayer IMG_1085

MXPlayer IMG_1084

In this case ExoPlayer supports most of the formatting, but I'd like to have the ability to let it know about the fonts somehow. It could be by specifying a folder with the font files or something else.

For bit more context, on the server side I have the files like this: image

nielsvanvelzen commented 3 months ago

Once again, subtitles are baked in on the server. The client doesn't need access to any fonts.

ArceyTheSecond commented 3 months ago

Once again, subtitles are baked in on the server. The client doesn't need access to any fonts.

When using an external player such as MX Player or MPV there is often no baking in, as you don't need to transcode at all in most cases. When the MKV has no fonts packed with it, there is no way for the external player to get them anywhere (a Linux or Windows cliënt will be able to use systemfonts, but unfortunately Android has no such luck), resulting in this particular feature request.

It would be 'best' to have them added to the MKV in the first place, but this creates it's own set of problems. Especically if every seperate MKV would have to contain them. (Increased filesize, having to go through potentially thousands of MKV's etc).

nielsvanvelzen commented 3 months ago

Ok I understand what you mean now. You want to have our app send external font files to an external player. This is impossible. There is no standard way to talk with external video players and I've never seen one of them supporting external fonts. You would have to add the fonts to the media file or somehow configure it in the external app yourself.

Closing as wontfix (impossible).

ArceyTheSecond commented 3 months ago

Ok I understand what you mean now. You want to have our app send external font files to an external player. This is impossible. There is no standard way to talk with external video players and I've never seen one of them supporting external fonts. You would have to add the fonts to the media file or somehow configure it in the external app yourself.

Closing as wontfix (impossible).

Understandable.

This (indeed obviously) isn't something we can add to any external player, my educated guess would be that @pushrbx would like to have this option for the ExoPlayer (as that is the one he has to use sometimes as explained in post 1).

Just to clarify though; we're not asking for a way to download the fonts for us or anything on that scale. Merely the option to point the Exo Player to a 'fonts' folder that the user can fill himself with the relevant ('fallback') fonts to use for the rendering of ASS subs.

pushrbx commented 3 months ago

The jellyfin server docs only mention that per OS the fonts need to be installed system wide to be baked in. Weirdly it doesn't do that when I just specify the fallback fonts folder. I'm running the jellyfin server in a container, and just now I tried to bind my fonts folder in the container (~/.local/share/fonts -> /usr/share/fonts/misc), and that made ExoPlayer (default player?) display the fonts correctly. I didn't know this. Sorry for the trouble. Also my understanding was that the subtitle file is streamed somehow to the client, and the client has to find the fonts.