jellyfin / jellyfin-androidtv

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

Allow to set two external player, based on SDR vs HDR,DV, alternatively settable per Library. #1691

Closed Andy2244 closed 2 years ago

Andy2244 commented 2 years ago

Describe the feature you'd like

It would be nice to-be able to set different external player's, based on SDR vs HDR, Dolby Vision content. Alternatively settable per Library.

The issues is that most DV/HDR content only plays correctly using the internal Exoplayer or whatever internal player was adapted to play DV correctly. On the other hand "normal" players like mpv/vlc have much more options and control over audio/subtitle streams or plugin support to handle more complex scenarios, than newer Exoplayer based players.

So by allowing a two player setup, we could use Exoplayer based for HDR/DV content and more advanced for normal SDR content. In my use case i want to use mpv with plugins for better automatic Anime audio/subtitle handling, which is out of scope for most normal players. Yet mpv can't play/passthrough DV content correctly.

PS: I think the "Auto" setting already does something similar by selecting Exoplayer or libvlc? So instead of this just have a setting with two entries SDR:HDR and allow to set the players, which could be either default or external?

nielsvanvelzen commented 2 years ago

External player support is temporary until our internal playback code is rewritten. There are no intentions to extend the current external player support.

Andy2244 commented 2 years ago

External player support is temporary until our internal playback code is rewritten.

Thats unfortunate, since i don't know any player that can correctly setup Anime audio/subtitle rules, without special rules or plugins. For mpv i'm using mpv-sub-select.

So what are the plans regarding this issue? Just ignore it and users always have to switch subtitles/audio manually or maybe use something like LAV audio/sub rules in a settable custom textfield?

nielsvanvelzen commented 2 years ago

You can set the default/forced flags in MKV containers to change what subtitle/audio/video track is used by default, there's also some settings in the web interface (although I'm not sure if the app respects those).

Andy2244 commented 2 years ago

@nielsvanvelzen Not sure you understand what i mean? Do you watch Anime yourself, if so how did you setup Jellyfin?

Here is the LAV splitter sub/audio rules i use as example, that i can use in most directshow players: audio: jpn,eng subs: jpn:eng|d;jpn:eng;jpn:*|d;eng:eng|f;*:eng|d;*:*|f

I don't think something like this is possible with Jellyfin?

Here is the mpv subtitle plugin example:

[
    {
        "alang": "*",
        "slang": "forced"
    },
    {
        "alang": ["jpn?", "ja"],
        "slang": "eng?",
        "blacklist": [ "sign", "song" ]
    },
    {
        "alang": ["jpn?", "ja"],
        "slang": ["und", "jpn?", "ja"],
        "blacklist": [ "sign", "song" ]
    },
    {
        "alang": ["eng?", "no"],
        "slang": "no"
    },
    {
        "alang": "*",
        "slang": "eng?"
    },
    {
        "alang": "*",
        "slang": "und"
    }
]
nielsvanvelzen commented 2 years ago

We do not support such a function right now, but like I said you can change the forced & default flags for the tracks in your files so Jellyfin plays them by default.

Andy2244 commented 2 years ago

Ok thanks, but i'm looking for a general automatic solution, since thats whats already working fine in Windows via mpv/LAV. So please consider adding something similar, as advanced option?

mueslimak3r commented 2 years ago

Ok thanks, but i'm looking for a general automatic solution

I made a little script for parsing my media library for subtitles (https://github.com/mueslimak3r/strip-embedded-subtitles). Perhaps it may be helpful in some way as a starting point if you want to do this stuff at the file level. If I were to attempt this kind of sorting/filtering I would probably do it at the media-file-level and edit the media files using ffmpeg and/or mkvtoolnx to strip out the unwanted tracks and change the default/forced flags.

ffprobe should be able to list the details of each file, and its output could be used to apply the filtering/parsing rules you posted

I would choose to do this at the "file level" instead of relying on clients to support stuff like this because once it's done, it works with any client.

Andy2244 commented 2 years ago

Ah ok thanks, is the remuxing done in-place or does this mean each file has to-be fully rewritten to disk?

PS: Just testing Plex atm and there i have much finer control over the automatic subtitle selection (better but not perfect) there are options for Forced/Sing&Song and how to handle selection if default/prefered audio lang. is different/changes from main.

mueslimak3r commented 2 years ago

Ah ok thanks, is the remuxing done in-place or does this mean each file has to-be fully rewritten to disk?

In my tool it renames the old file and remuxes into a new one. The tool has a parameter that can bulk restore or delete the backed up originals.

I think the reason it does remuxing is because I'm removing tracks. If I were to just change the default/forced flags, that shouldn't require remuxing. I've used mkvtoolnx to change flags in-place before. The basic structure of the script should be like 90% of what's needed. The parts that parse the output of ffprobe to decide if actions should be taken, and the part that calls ffmpeg to remux, could be swapped out for whatever you need.

Andy2244 commented 2 years ago

ok thanks

Andy2244 commented 2 years ago

@mueslimak3r i ended up writing my own script, since i wanted to-do all this without any remuxing, changes to the actual streams. You can check it out here: https://github.com/Andy2244/subby