Nevcairiel / LAVFilters

LAV Filters - Open-Source DirectShow Media Splitter and Decoders
GNU General Public License v2.0
7.34k stars 789 forks source link

Support string-search for advanced subtitle mode #484

Closed Kokujou closed 11 months ago

Kokujou commented 2 years ago

Hello. I want to realize the following scenario: When having german audio (ger), i want to have only forced subtitles. the syntax for this would be ger:*|f

now, the problem for this is, not all subtitle creators are as nice as normal people to set the forced flag for their sub instead, they will just name it "German Forced [ger] (ass) [default]"

so i want to request a pattern, that allows me to select the subtitle by name. my proposal would be something like this: ger:forced meaning, for the german language select subtitles containing the word "forced", similar would be ger:forced if you want to make the "contains"-functionality explicit or ger:"forced" if you want to make it clear that we're talking about string-search

i already tried some things to work around, but i can't think of any way to do it with negations. ger:|!n wouldn't work because you would still select default subtitles - i don't want that ger:|!n!d would'nt work in case the forced subtitle is a default subtitle - like in my current case

Nevcairiel commented 2 years ago

You can already match against the name

"ger@forced" would look for a german track that contains the string "forced" in its title.

The @ should always be the last part, so you can also do eg. "ger|d@forced" if you want to include a flag.

The only limitation is that the string cannot contain spaces (or commas or semicolons), so you can only match a single word, but for checking for Forced that should be plenty.

Kokujou commented 2 years ago

awesome :o then my only suggestion is to put that as an example in the git documentation^^ thank you!

Kokujou commented 2 years ago

ah ... and another request: please make it case insensitive ^^