mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Subtitle autoselect improvements

Open rcombs opened this issue 4 years ago • 6 comments

Addresses #8863

  • (Some platform-specific infrastructural tweaks to provide needed routines)
  • Support for matching 2-character language tags against 3-character ones, and vice versa
  • Minimal IETF language tag matching support, with support for 2-subtag tags (language+region)
  • Full subtitles off by default when audio language matches preferred subtitle language
  • slang defaults to the user's OS-level preferred language list
  • Additional controls for subtitle autoselection behavior
  • Fix various issues with forced-only autoselection
  • Expose forced-only autoselection in CLI
  • Expose forced-only autoselection and provide toggle in OSC

rcombs avatar May 26 '21 23:05 rcombs

Swift: avoid unnecessary unsafe conversions; fixes crash in debug builds is an unrelated commit and should not be included in this PR. i will comment on the actual change there.

Akemi avatar May 27 '21 17:05 Akemi

Yeah, I just can't debug without it.

rcombs avatar May 27 '21 17:05 rcombs

Updated with some changes:

  • User language detection now works correctly on Windows (and has been tested there)
  • Forced-only autodetection behavior is now better-exposed in properties
  • Forced-only sub mode is now exposed, and toggleable, in the OSC (though the indicator is currently very simple and text-based)

rcombs avatar Jun 26 '21 06:06 rcombs

(Re-pushes fix meson build)

rcombs avatar Nov 29 '21 00:11 rcombs

Rebased on latest master.

rcombs avatar Apr 05 '22 02:04 rcombs

I'm still using version 0.32.0 MPV from January 2020 due to https://github.com/mpv-player/mpv/issues/8396, since this has yet to be merged.

NaruZosa avatar Sep 11 '22 13:09 NaruZosa

Thank you ❤

NaruZosa avatar Feb 20 '23 06:02 NaruZosa

Pushed with comments addressed.

rcombs avatar May 11 '23 19:05 rcombs

So I tested this and here are my thoughts:

  • the automatic selection changes work well in general
  • slang and subs-with-matching-audio default change needs to be documented in interface changes
  • maybe there could be some smart rules to hide the [F], when watching non-dubbed content it just acts as a funny alternative to pressing v
  • when no sub tracks are present the [ ] never appears, if no track is selected it appears but is disabled. intentional?
  • I couldn't get the signs track to be properly selected with slang=auto on this file, but I think that's a file issue -> https://0x0.st/HqXu.mkv

sfan5 avatar May 21 '23 13:05 sfan5

Just as a note, I'm kinda hoping someone can eventually come up with an icon pair to replace the [F].

Re: docs, sure, I'll write 'em up. Re: automatically hiding [F] when not relevant, I could probably decide based on sub format for now (forced events only really apply to vobsub and PGS right now); maybe long-term this should be exposed by lavc as a flag in AVCodecDescriptor. Re: inconsistent display of [ ], I'll take a look; I don't recall the details there. Re: that file, yeah, it's improperly tagged (nothing's marked as forced).

rcombs avatar May 21 '23 14:05 rcombs

Re: [ ] display, what behavior would you prefer? I could hide it altogether whenever the currently-selected track isn't either dvdsub or PGS?

rcombs avatar May 27 '23 23:05 rcombs

Rebased and re-pushed; I believe all comments are addressed. Forced-only is no longer used for codecs that cannot include forced events, and the [ ] box is hidden when such a codec is not in use.

rcombs avatar May 27 '23 23:05 rcombs

one more: I'd rename

Add more precise sub fallback options

to

player: add more precise sub fallback options

sfan5 avatar Jun 09 '23 08:06 sfan5

needs rebase

sfan5 avatar Jun 23 '23 17:06 sfan5

Rebased and addressed commit-message issue; are we good to merge?

rcombs avatar Jun 24 '23 20:06 rcombs