-
Notifications
You must be signed in to change notification settings - Fork 104
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
JSO never performs VSFilter colour mangling #152
Comments
this is because the .ass subtitles included |
full file: 4Tsumiki.ass.txt |
JSO needs to know the video colourspace to accurately deal with most ASS colours. See libass’ docs for
Not putting any |
so then is this not the issue causing this? or more like what would be the underlying issue causing this? |
It most likely is the cause. |
hmmmmm if TV.601 is the default value then I don't really know what else to do here... JSSO simply cant handle this case? I don't really understand the underlying issue, but I assume normally subs are meant to be layered on top of the video and then color converted by whatever the video color range's are to what's meant to be displayed but JSSO goes around that as it renders on top of a video instead of together with it, which means it never ends up getting that color correction and is where the issue lies? |
@TheOneric is the only way to fix this problem is to know the video metadata, aka color space? I've been trying to read up on this, but haven't gotten much information as to implementation details. I've found a way to extract colorspace metadata from videos in browser, if that is going to be of any help? |
Yes, this is a necessary part of the solution.
The link to the related libass docs in my first reply here already contains the full details. (As there were some rewordings since, I also just updated the link to point at the newest version.) |
I could probably fix this, but I'm not certain what actually would need to be done in this case, could simply changing what color space is given to libass itself in the subtitle file be a potential fix? or does it need to be done after libass spits out its images edit: ah I see, seems like manual post-processing/color correction is needed for this, yikes |
seems like we could "borrow" some of the MPV code for this https://github.dev/mpv-player/mpv/blob/59fc8eecbc08d22368451b31fcf799aec557ab0d/sub/sd_ass.c |
Looks like it's this function specifically: |
yeah, but there's a lot of other black magic happening there that I honestly can't wrap my head around and I'm not sure what a lot of it does :/ |
@TheOneric if you ever want to come back to this, I can see 2 ways of doing this, the same way that MPV does it, so pretty much steal their code for this, or use SVG filters, TLDR a canvas context can have a filter which can be an URL, which can be an SVG filter, those can do color matrix conversions but I can't find any reliable info on how to do the math for the RGB conversion for this, but the matrixes can do:
where W is hard offset the video colorspace can be extracted via VideoFrame object, which is supported everywhere except firefox via I fixed this in my renderer like this: ThaUnknown/jassub@5047e18 |
I remember there being talk about some cases where JSSO has color inaccuracies in the bitmap decode calculation and I reproduced this on
[SakuraCircle] Acchi Kocchi - 09 (BD 1920x1080 HEVC FLAC) [CB0433CA].mkv
wherefd91a0
is calculated asf484a1
@ 15:51The text was updated successfully, but these errors were encountered: