-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
sub: add --(sub/osd)-border-style & refactoring option naming to match ASS spec #14195
base: master
Are you sure you want to change the base?
Conversation
Download the artifacts for this pull request: |
@KonoVitoDa plz test it. |
Works perfectly, thank you very much! |
00ecac4
to
e306696
Compare
close #10464 instead |
Can we also switch to tight by default? |
What's the point to make a breaking change? IMO this option is only related to personal preference. Users can easily set this option by themselves. |
How do I get the updated version with the new feature implemented? |
Before this is merged, you can get the build artifacts from https://github.com/mpv-player/mpv/actions/workflows/build.yml. Keep in mind you need to find build artifacts of correct PR. After this is merged, you can get it from unofficial nightly builds https://mpv.io/installation/ |
Users can change many options by themselves, but there's still value in the default value being something that doesn't need to be changed for most users. I'd argue the current bounding box is not wanted by anyone. |
Patches welcome. Please contain default changes and associated bikeshedding to a separate PR. |
output-new.txt The video file is the 01 from here: https:// nyaa . si/view/1752250 |
I cannot reproduce it. With the same commit of mpv and same set of subtitle related options in your My log: My options:
|
Really weird. Is not it related to the used FFmpeg version? |
mpv's CI statically links with ffmpeg. It's not overridable. Many unofficial builds also do that.
I don't think it is related to ffmpeg version. I think it is related to your scripts. You may try Anyway, imo |
It's documented that most subtitle options don't affect ASS subtitles. |
Oh, I was sleepy and forgot to mention that I use this keybind to switch between sub's original style and my own style: Both of the screenshots I shared before were with |
Reproduced with |
Well, if this only occurs with specific subtitle lines (this one is a typesetting), so I think it's not a big problem. Actually it makes sense to have a totally grey |
But it would be great if this behavior could also be customized by user. |
It is related to the selection of different colors in ASS. BorderStyle=3 will use OutlineColor and BorderStyle=4 will use BackColor. You can use |
OK. I keep them as aliases. No interface breaking change now. |
4f581c7
to
894f577
Compare
77e663d
to
c68f873
Compare
Hi. Any news? |
My work is finished. Please be patient. People need time to review and test the PR. |
I think the 2 commits can be squashed, and local has_shadow = mp.get_property('osd-back-color'):sub(2, 3) == '00' in console.lua should become local has_shadow = mp.get_property('osd-back-color'):find('box$') == nil |
c52a886
to
cb5b9aa
Compare
cb5b9aa
to
ddb5388
Compare
ddb5388
to
5737107
Compare
Also |
if (opts->back_color.a) { | ||
style->BackColour = MP_ASS_COLOR(opts->back_color); | ||
style->BorderStyle = 4; // opaque box | ||
} else { | ||
style->BackColour = MP_ASS_COLOR(opts->shadow_color); | ||
style->BorderStyle = 1; // outline | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe keep this compatibility if --*-border-style
isn't explicitly set. This means keep these two colors as separate options and avoid changing the default for back-color
to a non-transparent value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it's too smart. I consider these options orthogonal.
@Dudemanguy I just want to make sure that these names aren't confusing so that they won't be unnecessarily renamed/removed after the fact. |
If what happens changes completely depending on the border style, I think we're just doomed, no? I don't have any good name ideas anyway. |
The alternative is that we add separate options that make sense, like one for each background color, shadow color, border color, margin size etc., and apply the appropriate ones based on the border style selected. I think it makes no sense that if I want to change the border style from opaque box to background box I need to change the values of both border size and shadow offset just to keep the margin size, for example. Instead it can be a single margin size option which depending on the border style set, sets the corresponding underlying ASS properties. |
5737107
to
6e37fed
Compare
IMO 1:1 mappings from CLI options to upstream's options are intuitive. Despite historical reasons, ASS spec and libass are designed to be in that shape, and users can consult the spec of ASS and the doc of libass by themselves if in doubt. Using a complex option handling and mapping logic will make things complicated and hard to understand, unless we thoroughly describe our logic in the documentation, which is a maintain burden and a reinvention of existing spec. |
What should be done with |
6e37fed
to
51508c1
Compare
Sorry, I forgot it. It turns out |
that draw background that tightly wraps each line of text.
Fixes #14194