Closed duxovni closed 2 years ago
In what situation would you want to exclude forced tracks?
I'm looking at a video file with the following tracks:
(+) Video --vid=1 (*) (hevc 1280x720 23.976fps)
Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
(+) Audio --aid=2 --alang=jpn (aac 2ch 48000Hz)
Subs --sid=1 --slang=eng (*) (f) (ass)
(+) Subs --sid=2 --slang=eng (ass)
Subtitle track 1, the forced subtitles, only has songs and signs; subtitle track 2 has subtitles for the full dialogue, so that's the one I want when I'm using the Japanese audio. My understanding is that avoiding forced subtitles is also mpv's default behavior without this plugin:
--subs-with-matching-audio=<yes|no>
When autoselecting a subtitle track, select a non-forced one even if the selected audio stream
matches your preferred subtitle language (default: yes). Disable this if you'd like to only show
subtitles for foreign audio or onscreen text.
Can you send me a link to the video file?
Not really, it's not posted anywhere that I'm aware of. Regardless, it seems like this is in line with the purpose of forced subtitles. In addition to the mpv manpage snippet above, for instance:
https://handbrake.fr/docs/en/latest/advanced/subtitles.html
Forced Subtitles
With some DVD sources, there is a subtitle track which only displays during foreign language sections of the video. On some titles this is a unique subtitle track in the same language as the main audio track, on others it uses the standard subtitle track in the same language as the main audio track except marks a subset of the subtitles as forced.
My understanding is that the point of "forced" subtitles is that they're the subtitles that still need to get displayed when you're listening to an audio track in a language you understand, and you don't require closed captioning in general - i.e., forced subtitle tracks specifically just provide subtitles for onscreen text in other languages, segments of dialogue or lyrics that are in a different language from the rest of the audio track, etc. So in most cases, forced subtitles are useful if and only if they're used with an audio track of the same language. For audio tracks in other languages, it's important to use non-forced subtitles if available, since those will have the actual main dialogue.
Ok, sorry for taking a such a long time to get back to you, here are my thoughts on this:
My understanding is that avoiding forced subtitles is also mpv's default behavior without this plugin:
I'm not sure that this is the case, but I can't seem to get that option to actually do anything in any of my tests.
So in most cases, forced subtitles are useful if and only if they're used with an audio track of the same language. For audio tracks in other languages, it's important to use non-forced subtitles if available, since those will have the actual main dialogue.
Yes this is a good point, and I will be changing the default example configs to use these settings instead of triggering on any alang:
{
"alang": ["forced", "default"],
"slang": "forced"
}
But anyway as to your PR I do agree that it might be a good idea to have some way of white/blacklisting slangs and/or flags. I'm not totally satisfied with the way this works, but I may work on a way to extend this later, for the time being I'd be okay with merging it. I've left a review with a few changes requested about the documentation, but after that it should be good.
@duxovni It is now possible to exclude forced subtitles using the condition field with: "condition": "not sub.forced"
. Do you think it is worth reverting the changes from this PR?
If there's another way to exclude forced subtitles, then it seems fine to revert this.
Currently, if I have a rule like
if the first English subtitle track is forced, that track will still be chosen over other non-forced tracks. I want a way to write rules that specifically exclude forced subtitles, which isn't currently supported by the
blacklist
parameter.