mpv icon indicating copy to clipboard operation
mpv copied to clipboard

forced-track flag is not respected

Open BadIDMan opened this issue 4 years ago • 14 comments

Important Information

Provide following Information:

  • mpv version: 0.33.00-25
  • Windows Version: 10
  • Source of the mpv binary: https://sourceforge.net/projects/mpv-player-windows/files/
  • If known which version of mpv introduced the problem: latest version introduce this issue. Previous used version: 0.32.0-563 was properly behave for subtitle stream with force flag.
  • Possible screenshot or video of visual glitches

Reproduction steps

Reproduce steps: set forced-track flag on subtitle stream using mkvtoolnix, add some other subtitles streams without this flag set and open this file with mpv - subtitle with forced-track flag will not be displayed as it was in 0.32.0-563 mpv version.

Expected behavior

Subtitle with forced-track flag set should be displayed automatically.

Actual behavior

Subtitle with forced-track flag are not displayed automatically (see first attached file) User have to enable this stream manually.

no subs streams are automatically started

subs streams - one is forced

BadIDMan avatar Dec 13 '20 22:12 BadIDMan

Probably this commit https://github.com/mpv-player/mpv/commit/c9474dc9ed6172a5f17f66f4b7d367da6b077909

I can reproduce, and my last working build was right before that commit.

Doofussy2 avatar Dec 14 '20 04:12 Doofussy2

As amended, I have notified in the IRC last week this and also https://github.com/mpv-player/mpv/issues/8311 The reason that yet I play the old stable version all this year!

lon0 avatar Dec 14 '20 18:12 lon0

This issue is still not resolved in 0.33.0-67 version.

BadIDMan avatar Feb 08 '21 19:02 BadIDMan

that's why this is issue is still open and hasn't been closed yet.

Akemi avatar Feb 08 '21 21:02 Akemi

Maybe is not an ultimate solution, but you can add this in mpv.conf and the forced sub of your languages will be played, work fine when is the first sub track muxed because the first language will have the priority

sub-forced-only
slang=<languagecode[,languagecode,...]>

lon0 avatar Mar 17 '21 15:03 lon0

Please provide an example configuration + set of streams (audio + subtitles, language + flags, text rather than screenshot).

It's not clear what problem you're actually having. If you want to use forced tracks rather than unforced ones when playing files where the sub language matches your language preference, you should use subs-with-matching-audio=no (maybe this should be the default?).

rcombs avatar May 26 '21 04:05 rcombs

Please provide an example configuration + set of streams (audio + subtitles, language + flags, text rather than screenshot).

It's not clear what problem you're actually having. If you want to use forced tracks rather than unforced ones when playing files where the sub language matches your language preference, you should use subs-with-matching-audio=no (maybe this should be the default?).

@rcombs It doesn't work at all. Use any sub that is flagged as forced, and it isn't played by default.

Using:

sub-forced-only=yes
subs-with-matching-audio=no

should play the forced subs, but it doesn't. Prior to that commit, it would play the sub track that is tagged as forced.

Screenshot 2021-05-25 221051

Doofussy2 avatar May 26 '21 05:05 Doofussy2

After a bit of poking on Discord, we discovered that this is happening specifically for users who don't set slang at all, which results in funky behavior since no track matches their language preference of nothing.

I have a few tweaks to suggest for these cases; I'll open another issue for discussion.

rcombs avatar May 26 '21 06:05 rcombs

After a bit of poking on Discord, we discovered that this is happening specifically for users who don't set slang at all, which results in funky behavior since no track matches their language preference of nothing.

If I set my slang to a language other than the language of the forced track then It still doesn't work. So it's not about not about not setting "slang at all".

Yes I could set a list of every possible sub language I would want. But if the language of the track is not a normal language then it will not work (I've seen this done)

Anyway that should not be the expected behavior for forced subs. They should be forced.

Pikanet128 avatar May 28 '21 02:05 Pikanet128

If you speak 6 languages you're going to have to list them all. Sorry if that's a huge problem for you.

rcombs avatar May 28 '21 04:05 rcombs

that really is not the issue. if I use slang then subs always show up even on files with no forced track. and sub-forced-only does not seem to do anything about it. (not sure why).

Pikanet128 avatar May 28 '21 07:05 Pikanet128

This is probably related to the issue I fixed in 41bad0c9ab9431dc6fe051a9dfd8d2ab43bee165. Please test on the #8865 branch.

rcombs avatar May 28 '21 17:05 rcombs

How is this not fixed yet? It's like a basic functionality on pretty much any video player. I set forced subtitles with default & forced flags and mpv still not selecting them by default for me but when I set the audio that I want with default flag it respects my choice.... Doesn't make any sense. It respects the flags for audio but not for subtitles ?

kaypoush avatar Sep 11 '22 11:09 kaypoush

I know, nagging is annoying, but: Any news on #8865 ? It's really ugly to cycle through various subtitles to avoid missing forced ones.

aufkrawall avatar Oct 13 '22 08:10 aufkrawall

Forced Flag not working on windows 10. This should be high priority.

Version is mpv-x86_64-v3-20230402-git-0f13c38

AXiSource avatar Apr 07 '23 15:04 AXiSource

Hello everyone, take a look at this LUA script! I hope it will be helpful: https://github.com/pzim-devdata/mpv-scripts ;-)

pzim-devdata avatar Jun 25 '23 01:06 pzim-devdata

Hello everyone, take a look at this LUA script! I hope it will be helpful: https://github.com/pzim-devdata/mpv-scripts ;-)

We want the opposite of that. We want to used forced subtitles, not exclude them.

Doofussy2 avatar Jun 25 '23 01:06 Doofussy2

You just need to modify this LUA script on line #4: if sub.type == "sub" and not sub.forced and (sub.title == nil or not sub.title:find("SDH")) then to: if sub.type == "sub" and (sub.forced or (sub.title ~= nil and sub.title:find("SDH"))) then

I have added SDH to FORCED

You can also modify the script to play a specific langage. For example, if you want the script to play English subtitles and include the FORCED and SDH ones, you can make the following modification to line #4:

if sub.type == "sub" and not sub.forced and (sub.title == nil or not sub.title:find("SDH")) then

Replace it with:

if sub.type == "sub" and sub.lang:find("en") and (sub.forced or (sub.title ~= nil and sub.title:find("SDH"))) then

By adding the additional condition sub.lang:find("en"), you are checking if the subtitle language matches "en" (for English). This modification ensures that only English subtitles which are FORCED or contain "SDH" in their title will be selected.

pzim-devdata avatar Jun 25 '23 02:06 pzim-devdata

Fixed with #12100. Note that forced subtitles will only be selected if the audio language matches the subtitle language. If you always want to select the forced track regardless of the language, you can use --subs-fallback-forced=always.

Sidenote: OP's example is also tagged as default so it would get selected by default anyways.

Dudemanguy avatar Aug 28 '23 18:08 Dudemanguy