mpv
mpv copied to clipboard
sub: merge vsfilter-aspect and vsfilter-blur-compat options
Attempt to resolve the issues laid out in https://github.com/mpv-player/mpv/issues/10680
If it later turns out there’s some oddball case where the old aspect-compat=no blur-compat=yes was actually desirable afterall, i guess this won’ŧ fit well into the new choice option. But if actually desired in practice a new and more powerful sub-ass-video-aspect-override could be added to fake any arbitrary PAR value just for libass (analogous to the general video-aspect-ratio)
EDIT: added a commit introducing this option although i still can't think of any situation where it’d be needed
The naming for "blur-compat" was misleading since the setting actually affects more than just blur affects. Additionally forwarding storage resolution but forcing an aspect ratio of 1.0 for the video is likely to result in odd rendering and there’s no known usecase for it.
Both options control which video properties are exposed to libass so to fix the aforementioned issues merge these settings into one tri-state sub-ass-use-video-data.
The default V keybind now cycles through all states of use-video-data instead of toggling vsfilter-aspect-compat.
Here’s an example file which renders clearly different for each setting: example_ass-use-video-data.mkv.zip
I’m not sure why one test is failing for mingw64, but given everything passes in other builds, including mingw32 and ucrt64, perhaps it’s a fluke?
Download the artifacts for this pull request:
If it later turns out there’s some oddball case where the old
aspect-compat=no blur-compat=yeswas actually desirable afterall
If I have a "simple" subtitle with some text with blur and requires blur compat, which is written for a non-anamorphic source and I want to use the subtitle with an anamorphic source with the same display size instead, and without being able to set aspect-compat=no blur-compat=yes, I will have to live with either wrong blur or stretched/misplaced text. So I think there are some values to keep these options separate.
Nonetheless, it currently doesn't work as expected and looks different no matter the combinations of aspect-compat blur-compat used.
If I have a "simple" subtitle with some text with blur and requires blur compat, which is written for a non-anamorphic source [...]
As you already observed aspect-compat=no blur-compat=yes won’t give you the desired result either, since anamorphic ad non-anamorphic videos differ in both their PAR and their storage resolution; ~~at the very least blurs will be stretched in one dimension for your subs~~ (wrong way around; this would happen if the original was anamorphic; but other things are affected) some things might be squished in one dimension from PlayRes→StorageRes scaling which no longer is counteracted by PAR scaling (and the more complex (combinations of) tags are used the mroe might break).
The correct way to reuse such subtitles is setting LayoutResX and LayoutResY headers to the storage resolution of the original video with correct rendering. LayoutRes headers take precedence over all API-supplied video properties.
You can do so either by modifying the subtitle file, or on-the-fly with --sub-ass-style-overrides=LayoutResX=555,LayotResY=333
If it later turns out there’s some oddball case where the old
aspect-compat=no blur-compat=yeswas actually desirable afterall, i guess this won’ŧ fit well into the new choice option. But if actually desired in practice a new and more powerfulsub-ass-video-aspect-overridecould be added to fake any arbitrary PAR value just for libass (analogous to the generalvideo-aspect-ratio)
Added a commit introducing this although i still can't think of any situation where it would be useful. Feel free to drop this part to avoid unecessary option bloat, or if you’re more concerend about limiting options keep it. Either way at least all misleading bits will be gone.
mpv v0.38.0-791-g22620af4 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
built on Sep 17 2024 20:49:05
libplacebo version: v7.349.0 (v7.349.0-13-ga018ab0-dirty)
Saving state.
Option sub-ass-use-video-datasub-ass-override not found.
Exiting... (Quit)
It looks like this error appeared after this update.