CogentRedTester / mpv-sub-select

An advanced conditional subtitle track selector for mpv player
MIT License
89 stars 8 forks source link

Filter by subtitle format #13

Closed rollingmoai closed 2 years ago

rollingmoai commented 2 years ago

How do I filter by subtitle format (ass, pgs, srt, vtt, etc...)?

CogentRedTester commented 2 years ago

You can use the new condition option.

This would only choose english ass subtitles to use with Japanese audio for example:

    {
        "alang": "jpn?",
        "slang": "eng",
        "condition": "sub.codec == 'ass'"
    }

You can combine it with the whitelist blacklist properties as well. I have more details in the README. These conditions have the same syntax as conditional profiles if you're already familiar with those. Just without all the magic property value stuff.

Just be aware that the codec value of a subtitle is not always the same as the file extension. For example I think that srt actually has a subrip codec.

rollingmoai commented 2 years ago

Thanks, it seems to work as expected