-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix rendering with libass to match xy-VSFilter #134
Conversation
Since ASS rendering depends on the storage size of the video libass needs to know about it to render the subtitles correctly. If it isn't told about the storage size libass uses the value from PlayRes{X,Y} as a guess, but this isn't always correct. With Aegisub currently always rendering at storage resolution this ends up the same as the frame size.
473e0fc
to
bc8ed62
Compare
To clarify: the behaviour with patch will match not just xy-VSFilter but also classic guliverkli- and guliverkli2-VSFilter. VSFilterMod differs from both patched and unpatched Aegisub with libass iirc but VSFilterMod is explicitly only meant for hardsubbing and thus intentional incompatible with softsub renderers. Using libass without calling If you want to test this against historic builds, Aegisub r8250 has xy-VSFIlter bundled and will render the sample like follows (and patched Aegisub with libass will do the same): Currently, without the patch applied though, Aegisub with libass renders this, which is clearly incorrect: |
It looks fine if use 1920x1080 video, but display will change if use other resolution, such as 1280x720: This is very similar as HomeOfVapourSynthEvolution/xy-VSFilter#1. I don’t think priority match xy-VSFilter is correct, maybe they plan to solve it through LayoutResX/Y in the future, but maintain the consistency of rendering effects at different resolutions is more important. |
Doing what XySubFilter, xy-VSFilter, guliverkli2 and guliverkli all do identical is the most correct correct thing one can do with regards to ASS and what libass strives to emulate.
If you meant Aegisub+libass without the patch: It shouldn't if you followed the instruction to not resample the resolution. Changing the format in an incompatible way as you seem to suggest is simply not an option open for debate - period. Moreover, Aegisub without the patch won't even match other libass-using renderers, as they by now mostly set As for “consistency of rendering effects at different resolutions” the correct way to achieve this is via a coordinated introduction of a new distinct header (pair) in all major softsub ASS renderers. See libass/#597 for a current discussion on this. See also libass docs, if you still have doubts: |
My tests are based on builds with the patch.
Indeed, I realized this when using mpv. And I’ve seen this issue and libass/libass#597. I can also understand why matching VSFilter series even though VSFilter sucks. I am very supportive of fix the Aegisub's misuse of libass to maintain compatibility with other players, but I don't understand why not make changes in libass after LayoutResX/Y script headers done, then repair downstream software.
After patch whether only videos with the same resolution (storage size) between subtitle makers and softsub viewers can maintain the same rendering effect, then only set LayoutResX/Y = Subitle makers’ storage size can resolve it. |
I agree. Aegisub+libass should always match other libass-based tools/players. I guess I'll merge this after verifying with ffmpeg and VLC. |
Just a note: unlike e.g. mpv which used |
Are you sure you are using the correct VSFilter.dll in your guliverkli and guliverkli2 tests? If you can somehow reproduce your results with the original guliverkli(1|2) VSFilter.dll, I'd be interested in hearing the details of it. As for MPC-HC's internal subtitle render (ISR): it is known to deviate in several (i.e. not only the torage size issue) incompatible ways from classsic VSFilter behaviour and the expectation is that xy-VSFilter/XySubFilter is used for native ASS subtitles. I'm not sure if its ISR can even be used in Aegisub; is there some dll for it? Even so, when looking closely at your screenshots you'll notice that none of them match unpatched Aegisub+libass nor does MPC-HC match the supposed guliverkli renderings: To also address vxzms’ concern: Once LayoutRes is hopefully adopted by major renderers, the idea is to make Aegisub set the headers automatically (the exact semantics of when and to what still being discussed) so all new subs would become invariant under the video's storage size while old subs continue to be rendered as intended. |
Thx TheOneric, I wish it could be discussed and implemented as soon as possible. Vapousynth plugin https://github.com/HomeOfVapourSynthEvolution/VSFilter can be used in Aegisub, it based MPC-BE 1.5.3, and display same as MPC-HC's internal subtitle render. |
Nope. I was using the MPC executable directly, downloaded from these 2 links: I assumed that these MPC players behave the same way as VSFilter.dll, because I think that VSFilter.dll is just a wrapper of MPC's RTS.cpp. The VSFilter.dll from MPC-HC's release (https://github.com/mpc-hc/mpc-hc/releases/tag/1.7.13, in standalone_filters) matches the behavior of MPC-HC's internal subtitle renderer. Turns out this is not the case for guliverkli and guliverkli2's MPC and VSFilter. |
Since ASS rendering depends on the storage size of the video libass
needs to know about it to render the subtitles correctly. If it isn't
told about the storage size libass uses the value from PlayRes{X,Y} as
a guess, but this isn't always correct.
With Aegisub currently always rendering at storage resolution
this ends up the same as the frame size.
I'm confident the “rendering size == storage size” assumption holds true for Aegisub’s subtitle preview. From a glance it also appears to hold true for Aegisub’s csri frontends for CLI and AviSynth, but I'm less confident about those two. However, since csri currently only gets one size: if it isn't correct, this should also affect VSFilter-based backends.
You can see the different rendering on the following sample. Load it into Aegisub without resampling to video resolution and switch between xy-VSFilter or vsfilter_textsub (not VSFilterMod!) and libass; without the patch the result differs, with the patch it will match.
A furhter example can be found in Aegisub/Aegisub#269, but this is also affected by another bug where Aegisub doesn't de-squeeze anamorphic content before display in the subtitle preview.
Corresponding merge request for TypesettingTools/Aegisub: TypesettingTools#147