-
Notifications
You must be signed in to change notification settings - Fork 519
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
libass build #2163
libass build #2163
Conversation
I found a couple places that unloadass() had been removed since patch82--I added them back here, but maybe I shouldn't have. I remember some issue about that but I though you had fixed it by adding a check in |
Tests below. LIBASS left, MPC-HC on right: Test 1: Results are the same except LIBASS is able to render outside the frame |
…Calibri when font is missing
Test 5 issue has been fixed. The problem was being reported by mpc-hc, not libass. The libass was failing due to wide chars in the filename, which is "broken" in libass on windows even with utf8 filename. Also added an |
It seems to render relative to the window instead of the video. Or at least using a wrong res. |
It does use the spd but it allows render in the full window. I tried some options but nothing behaves quite like mpchc. |
With the sample above, if you increase window height to add black bars, then it wrongly renders the sub in black bar. |
Thanks for continuing to work on this. |
I rewrote the flattener code to limit the subs to the video window properly. However, I do seem to remember one mod we did to subtitles a few years back, to allow them to render below the video in some cases, like fullscreen with letterboxing? I bet that won't work without some mods. All cases above now work correctly, and in some cases only libass can get correct results (upside down TEST should no longer be a problem in mpc-hc renderer). |
Seems like those old letterbox issues were related to PGS, so maybe it doesn't matter. |
Usage of libass should be restricted to ASS/SSA subs. At least initially, to avoid regressions with other formats. ASS/SSA should always be positioned relative to the video frame. So adding black bars by resizing window height should not have any effect on the subtitle position or size. Current code seems correct now for that. SRT and other formats can have positioning relative to the window. "position subtitles relative to video frame" option not fully checked. So in that case What is the behavior of VLC/MPV for the test 1 sample? Do they render outside or cut off? Regarding test 2. I though rendering the full string was fixed previously? Maybe regression due to recent freetype changes? Can you make a fresh test build? |
What about two boxes--"use libass for substation alpha subs", "use libass for srt subs" ?
OK, I'll take a look at that.
Cut off.
I'm not sure yet why it fails. It seems to actually work with recent freetype codepath, but as of 2.0.0 release, it was broken. However, the original test (test11 above) did work with the same font. |
"Use libass for SSA/ASS" |
The solution only worked if the path returned zero points. In this case, |
Can you check if there is an issue with the test build? It looks like libass isn't being used, despite the option being enabled. I use this sample to test because I know that has issues with libass. |
Hmm, no it is working for me with the checkbox checked. If I uncheck it, I get the old behavior. |
Semi-checked means relative to video for SSA/ASS and relative to window for everything else. |
I meant a video/screenshot of what the output should look like with SRT and it being semi-checked. |
For SRT semi-checked is same as unchecked. You can see behavior by using ISR with libass disabled. |
This is implemented. |
External tracks are working. But embedded ones not. Sample with embedded tracks. |
It works for you because it isn't using libass. |
OK, it's now rendering with libass and reloading correctly for mkv tracks. However, fonts are bad... |
Well, maybe it's a good thing, because it replicates the VLC behavior per here: Hmm, forgot about this. |
Working better now. That font bug is why this sample is a good way to test if libass is active ;) Some issues with layoutres: Mem leak related to fonts: Are there any config settings for libass that might have effect on performance? Like cache sizes, etc. I have yet to test performance on some super heavy samples where ISR struggles. |
Heavy animated sample: CPU usage is much higher with libass :( |
My default is Calibri, what's yours? It could be a default font issue for sure. |
Also Calibri. |
I couldn't get the mem leak--how does it manifest? |
https://github.com/clsid2/mpc-hc/pull/2177/files See if that helps. Not sure if it will do anything extra, because I didn't set any style overrides, but it does more than just clear fonts. |
Never mind, it was already being called elsewhere. |
Maybe worth checking for performance. |
Will the OpenType language setting be available when not using libass? It would be quite useful to me, an average viewer who usually sticks to .srt and prefers the special symbols of his native language. |
I believe my freetype patch was merged already, which used the same setting together with the advanced freetype option. Unfortunately I don't think it works great in all cases. It renders individual characters instead of a string which may affect spacing at times. The test builds I made recently should have the advanced option. |
I should also mention, in your case I would recommend using the "libass for SRT" option. If you have simple subs it should work fine and it does support opentype. The advanced freetype option also may work, but I probably need to do some more work to make that sophisticated enough to handle full strings. |
Profiler shows a lot of time in the flatten sub. Not sure if this really helps much but I tried to optimize the calculations. |
There is sse2 code for it here, which might help as well: |
With this sample subs don't show up initially. They start working after a seek. I have not yet investigated what is wrong. It is also a very performance heavy sub for the translation part on the phone. |
https://github.com/clsid2/mpc-hc/pull/2180/files Didn't seem to make much difference. |
Have you noticed--if we disabled subs entirely on this video, it still lags...? |
The Ctrl+J graph is smooth here with subs disabled and MPCVR. |
I removed the libass tags from this build and moved some logic into a subclass to clean up STS and RTS. Here's a test build.
https://mega.nz/file/RIx03CCK#c9IXdtUmKnuj_4tjFhM6N7tho3yAzDL12PEbCVX5M2k
At least a few people have expressed interest in this so maybe they can test it out.