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

automatic track selection in addition to alang and slang #5133

Open
zc62 opened this issue Nov 20, 2017 · 2 comments
Open

automatic track selection in addition to alang and slang #5133

zc62 opened this issue Nov 20, 2017 · 2 comments

Comments

@zc62
Copy link
Contributor

zc62 commented Nov 20, 2017

I think this feature is particularly important when watching some videos with multiple audio tracks that have the same language code. For instance, a.mkv has a 2chn 16bit jpn track, corresponding a.mka has a 6chn 24bit jpn track and a 2chn 24bit jpn track. They only differ in the number of channels and bit-depth. If only --alang option is going to auto-select the track, it is unlikely that one can get the track desired. Ones who have decent stereo systems may prefer the 2chn 24bit track, who have 5.1 systems may prefer the 6ch track and the others may want the default 2chn 16bit track.

When it comes to the subtitle, the problems can be more complicated. One problem is that sometimes the authors of external ass subtitles miss the language code in the file, then mpv recognizes them as unknown. In this case, the language code or related information helping selecting the track might be in the filename (--sub-auto=fuzzy). Even for built-in PGS subtitles, slang alone can also have troubles. For example, Simplified Chinese and Traditional Chinese share the code chi.

In MPC-BE or Potplayer, this feature is pretty much implemented. I can specify 'stereo' to let the player prefer 2chn tracks (though I could not really pick up the 2chn 24bit track when the 2chn 16bit track is the default). Also, if the mkv file contains additional information describing what the languages really are, for example, I can use 'Mandarin' to match the Mandarin subtitle among a few 'chi' subtitles.

I hope this can also be implemented in mpv, so that users will have more freedom to customize the automatic track selection.

@zc62
Copy link
Contributor Author

zc62 commented Dec 4, 2017

After commit d5dae86, the unknown language code problem for external subtitle files is pretty much gone.

I found the external sub file should be named as:
movie_filename.lan.ext or movie_filename.something-lan.ext or movie_filename.something_lan.ext
where ext is the sub file extension, and lan is the language code that you specify (must be either 2 or 3 characters), for example, sc or chs for simplified Chinese. You can add something else before the language code (e.g., authorship of the sub, like Fansub-eng), by using a - or _ (or I am missing others) to separate them. It seems that lan-something does not work.

@Akemi Akemi changed the title Feature request: automatic track selection in addition to alang and slang automatic track selection in addition to alang and slang Sep 21, 2019
@Akemi Akemi added core:audio core:option-param-conf config, parameters, properties, options, shortcuts core:subtitle core:video labels Sep 21, 2019
@teohhanhui
Copy link
Contributor

There's https://github.com/CogentRedTester/mpv-sub-select which is already listed on https://github.com/mpv-player/mpv/wiki/User-Scripts

Seems like the best solution without having to write your own script.

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

4 participants