Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpv ignoring 'slang' option set on 'mpv.conf' in favor of external subs #14388

Open
6 tasks done
GuilhermeFrainer opened this issue Jun 19, 2024 · 11 comments
Open
6 tasks done

Comments

@GuilhermeFrainer
Copy link

mpv Information

mpv v0.38.0-476-gd2bd77ad Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Jun  9 2024 00:05:17
libplacebo version: v7.349.0 (v7.349.0-rc1-2-gbc9de9c-dirty)
FFmpeg version: N-115628-g658439934
FFmpeg library versions:
   libavutil       59.21.100
   libavcodec      61.7.100
   libavformat     61.3.104
   libswscale      8.2.100
   libavfilter     10.2.102
   libswresample   5.2.100

Other Information

  • Windows version: 10.0.19045.4529
  • GPU model, driver and version: RTX 4060, GeForce game ready 555.99
  • Source of mpv: sourceforge

Reproduction Steps

  1. Download video with embedded subtitles (in my case, English).
  2. Download separate substitles (in my case, Japanese) and rename them so their name matches that of the video file.
  3. Put the subs in a separate directory and set a path for that directory on mpv.conf with sub-file-paths
  4. Set slang in mpv so that the external subs' language is last on the priority list (in my case, slang=eng,en,enUS,jpn,jp.
  5. Open video and watch it as mpv ignores the priority list set in slang (choosing the external subs by default).

Expected Behavior

In my case, I was expecting mpv to respect the priority list in slang and choose the (embedded) English subs by default.

Actual Behavior

Mpv instead seemed to ignore the list in slang and set the (external) Japanese subs by default.

Log File

output.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@Dudemanguy
Copy link
Member

That's by design. External subs are always preferred. There are some other scattered issues around related to this (like #6071). Maybe this could be changed or made into an option but no one has ever tried.

@hooke007
Copy link
Contributor

hooke007 commented Jun 19, 2024

--alang is facing the same problem.
For some devs, external tracks may be preferred. They should think that if you don't want external ones, why leave them here.
But for some encoders/users, it's totally different. The more important/necessary tarcks will be embeded in videos. Others will move to the independent files.(Especially for audio tracks)

@Dudemanguy
Copy link
Member

It's pretty trivial to just move the language matching check above the external file stuff. But there's probably scenarios where people want the external tracks to be selected first, and I was never sure what the right way to handle that was.

@hooke007
Copy link
Contributor

Here is the workaround for OP.
https://github.com/CogentRedTester/mpv-sub-select

@kasper93
Copy link
Contributor

It's pretty trivial to just move the language matching check above the external file stuff. But there's probably scenarios where people want the external tracks to be selected first, and I was never sure what the right way to handle that was.

Probably just need an option... like everything.

@Dudemanguy
Copy link
Member

Dudemanguy commented Jun 19, 2024

Hmm, maybe something like --external-files-priority=<yes|no|auto>. I'm not sure what the best behavior for auto would be. Maybe like: external tracks that are specifically selected but with no language -> language -> external track with language -> autoloaded tracks ?

@guidocella
Copy link
Contributor

I wondered if this option was necessary in #9059. If it is added for every track type it should replace --audio-display's values.

@GuilhermeFrainer
Copy link
Author

Here is the workaround for OP. https://github.com/CogentRedTester/mpv-sub-select

I couldn't get it to work either unfortunately. Got the exact same issue. This is the sub-select.json file I was using:

[
    {
        "alang": ["jp", "jpn"],
        "slang": ["eng", "en", "enUS"],
        "condition": "not sub.external"
    }
]

I tried changing a few things around to no avail.

@hooke007
Copy link
Contributor

I couldn't get it to work either unfortunately.

You should report to the script creator, not here.

@kasper93
Copy link
Contributor

Maybe like: external tracks that are specifically selected but with no language -> language -> external track with language -> autoloaded tracks ?

Not sure I understand what you mean exactly. I think the external track with language specification should be preferred over internal tracks, if both matches slang selection.

@Dudemanguy
Copy link
Member

I was only suggesting putting external tracks with languages on the same "level" as the general language matching. But the external tracks would still be chosen before internal ones assuming there's no language-based selection. If we want to add the additional variable of preferring external vs internal tracks, we can but yeah it gets even more complicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants