-
Notifications
You must be signed in to change notification settings - Fork 2
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
Weird color bleeding #13
Comments
I can't reproduce that but that's just with opening that tiny "no shaders" image you posted. It's also possible it can't reproduced with such a tiny single png that is likely not even from source or is being scaled by whatever your default MPV settings are. |
So for some reason when using libplacebo with ffmpeg, and applying the shader directly, this behavior doesn't happen, but in mpv when it's applied to the video it occurs. Yes it's apart of a larger video, and the screenshots were taken from within mpv, then cropped. I'm not against providing an image, but I want to be able to test it first hand on the image. The problem is, when I launch an image with mpv, and scale, shaders don't apply, even if the image is within an mp4 container. Not sure how that works, am I missing some |
of course you can't reproduce that on the no shader according to the to me dead link it is an png so no Chroma to scale. here is another extreme example of prediction failing massively: https://i.slow.pics/SRXDnZ9i.png https://drive.google.com/file/d/1E7-XBHJ6Jlndafm5URsxCU3z-oAmZolW/view if you are fine with the usually issues of biliteral https://github.com/Artoriuz/glsl-joint-bilateral performs more save. |
You can scale luma above output but obviously it's not great for testing but not much else to do with so little available.
CFL seems to have quite a few issues with discolouring (mostly reds) and removing outlines (I created an issue for it ages ago here: #5 ). It is slightly better with the last change in master but still far from optimal so I've been trying to fix it myself. |
looks pretty much the same as ravu-r2 massive ringing and some aliasing it kind of looses to the bad super xbr implantation. i can't benchmark chroma scaler i get around 1200-1800 fps which falls down to around 600 from showing the OSD... and the GPU is at best at 60 % load if the OSD cost more then the entire rendering pipeline i'm not benchmarking. i can do decent test with image scaling from FHD to UHD which does not apply here. |
Could you give an example of the ringing and what are you comparing it to? It should be much better than CFL master, at least in my video I use for testing which is my most ringy example I have it's almost enough to eliminate it all. Also, are you testing with any other shaders or just on it's own? Aliasing is understandable at high scaling factors like 720->4k but I don't think it should be that high with 1080->4k? I mainly tested 720-1080p -> 1440p or scaling it to 4k but then it gets downscaled which likely removes some artifacts (especially aliasing). |
the gold standard for me is super xbr 100 i usual use 150 in comparisons to make a point. edit: i messed the images up again huhn english for chicken has an marble sized brain. the following stuff is to be ignored. one of them is ravu r2 another one is your new version which pretty much looks the same as ravu if you ask me and one of them is super xbr not the normal one it was ported from a pretty bad two path version. i'm not very confident in my mpv usage. when i usually do chroma it is native only chroma or the scaler after chroma is the same for all images. |
??? That's not very helpful... Is it possible you got the images mixed up? |
as usually i messed up i pressed control+s before control+v and it will use an empty shader just fine no error in the console or anywhere. real test: https://slow.pics/c/HE2JXUyl luckily it really rings even through i never saw it before. new predition decent chroma placement but ringing also shows issues with aliasing. ohh you call that an extreme sample? i have far worse ones but this is very very real one. the mpv super xbr version is trash but it still does better here in this one image at least in terms of ringing... but this version is soft very very soft. i don't want to turn this into an super xbr talk that's also one reason i didn't use the good super xbr: here some more test images and stuff: https://drive.google.com/file/d/1X6tIcONvEGHLBoCM_-mOn0syTuLweCW0/view?usp=sharing it just a zip with all stuff i did in the other test the 420 folder should be useful to you the abbration is used to show that bilateral scaler place Chroma wrong from time to time not to show the benefit of chroma scaler. good chance i messed something up again. |
I can't reproduce those random square artifacts or that insane colour bleeding in the other CFL screenshot. Have you tried making sure no other shaders are running? Maybe it's some other setting messing something up? Try running something like this:
doesn't really help because you didn't specify if you used the chroma specific one or not.
I tried the ones in your example, they weren't really tough at all, nothing in comparison to that Junji Ito sample.
The source image has heaps of aliasing but again, I don't see anywhere near as much with my shader, this is what I see: You seem to have way more issues than the shaders though, your colors look completely off to me, way too bright.
I watch almost entirely official sources so I just adjusted to my worst sample. Your test image has a decent amount and I do still see it, however it's not as noticible. I just realised that the way AR is set up in this shader it REQUIRES gpu-next since it's using a new gpu-next feature, really not sure what happens on vo-gpu, maybe it just sets it to 0? Maybe OP should also check if they are running gpu-next. |
I use |
are you on AMD?
i don't have appended in my config or input as far as i know i'm not able to run 2 shaders at the same time. my config is pretty much blank of cause i'm doing image comparison here deband=no. edit: error comes from gpu-api=vulkan
i was told mpv is always doing chroma to luma resolution first. so either it is not used at all or it is a chroma one.
the what?
a scaler should remove aliasing nearly every scaler does.
if you ignore the errors as i have the colors are exactly the same.
i have another input.conf which was not used here:
this works with this newer NN scaler |
@brian6932 Since it was impossible to reproduce with what you provided directly, I made myself a test clip: This is the output without any shaders: And this is the output with CfL: Everything is working as expected, so I don't know what you did. Assuming your actual video was a bit noisy, it's possible that the noise would occasionally put the backgroung closer to the red portion in luma intensity, which would explain why CfL would produce such "bleeding". There's nothing I can do about noise other than literally denoising the luma plane before using it, but doing that would hurt shader's capability of generating fine-detail. |
Yeah, I'm using an AMD 6700XT with DX11 on Win10 since it's been better than Vulkan pretty much always.
You can apply multiple shaders by separating with
The ones that hook at native or main will be after chroma has been upscampled to luma with the inbuilt chroma scaler (need to hook chroma to scale just chroma) and end up scaling both luma and chroma. That's why I was emphasizing the importance of it being just chroma scaling for comparison.
3fc1c1a#commitcomment-138326390 CFL and my attempts to improve the downscaler seem to fail miserably on that sample since it seems to be removing a lot of the shadowing, softer scalers do a lot better here but it's rare to see anything close to that sample in content.
Sure and if you check my screenshot, a lot is being removed but CFL derives Chroma from Luma, it's not supposed to change the whole image, that's more the Luma scaler's job. Ravu is pretty good at removing aliasing at the cost of thinning lines, however if you are on a slower system using both Ravu and CFL might be a bit too costly. If you want to remove even more aliasing you can overscale (idk the correct term) but scaling above output resolution so MPV does downscaling, however depending on the downscaler, a lot of detail can get lost in the process). |
that's super sampling. BTW. just using vo=GPU will give you wrong images in form of sRGB correction from gamma or with other words by default is is not leaving the image untouched but does changes the tone curve. |
No it's not. The chroma will match luma with the inbuilt scaler and the shaders that hood native/main will scale the combined planes.
Yes, it's tough for the original CFL but I spent a lot of time changing the downscaler specifically so it could handle reds/match source better and those samples aren't enough to cause any major issues with it but the Junji Ito sample completely trips it up (though it is better than my earlier attempts). |
my point was that it does not matter for chroma not that you can't do that. |
@mightyhuhn I think what you are looking for is https://raw.githubusercontent.com/Jules-A/glsl-chroma-from-luma-prediction/main/CfLP_Ravu (it's deus0ww's CFLxRavu combination replaced with my DS variant). Removes a tonne of aliasing for just a chroma scaler although it's 2-3x slower to run than CFL master. I also brought back the jinc window in my DS code: https://raw.githubusercontent.com/Jules-A/glsl-chroma-from-luma-prediction/main/CfLP_NewDS which smooths out small aliasing (mainly the furriness of using a hermite base) a bit and reduces blocking a little bit at the cost of some speed. |
i actually wanted to stay on topic because i saw similar issues with the scaler. i'm willing to talk about any type of chroma scaling here: i can not keep thsi to me but your super xbr is horrible. all your scaler are not chroma bleeding anymore. |
I kind of feel that's worse since this issue is at least closed and they aren't going to re-add complex shaders to inbuilt options. The colour bleeding may be a graphics driver issue or possibly the result of wrong MPV settings, however the OP didn't provide a source, didn't provide a log, didn't try running with no config so the issue is completely invalid anyway. EDIT: |
no the problem with super xbr that the port is not well the super xbr that is actually usable. this is how super xbr should look like: https://i.slow.pics/ba54ofsp.png or take this one an image where it actual does good: https://slow.pics/c/QJOn0psT or take this example: https://slow.pics/c/KbViAj68 |
Ok first of all, I did produce it on no-config, not that this is relevant at all, I'm using the shader as a control. Not sure wtf kind of logs you want. Second, I asked a question and no one responded.
I'm not uploading the whole video. |
Ah yeah, sorry, I guess it's not asked for anywhere but it's kind of impossible to reproduce the issue with no info at all. The logs are an easy way to get what settings used or if there were any errors (can be created by adding --log-file="D:\ExampleLogs\mpv.log" ect.) but honestly just knowing all settings used (copy of mpv.conf if there's a lot of changed stuff ect.) would be extremely helpful. As for source, a full screenshot or at least a larger crop would be way better than that icon you posted :/ though if it's something that occurs over multiple frames then something like losslescut to cut a few seconds would help more. EDIT: The log will also tell what hardware/OS you are running on which is extremely important...
Sorry, I missed that but most scalers have conditions to meet in order to scale, if you want to make sure it always activates you can simply delete the |
a jpg instead of an png is able to capture the screenshot at 4:2:0. |
Hell NO! NOT jpg or any other lossy formats... They destroy a tonne of detail that can never be recovered, while a lossless image can be encoded to anything that's needed. |
please don't do that to me. yes i could go and teach him mkvtoolnix yes i could even teach doing a lossless encode of the frame in question like i do for chroma comparison and where it is kind of needed. after we got that we can use that as a new groundtruth to see if the problem can be reproduced. if it works Artoriuz get's something to work with. |
@brian6932: I've not read whole thread, but I believe it is unrelated to your issue anyway. Let's focus on what you said.
This is interesting observation. In theory it shouldn't happen, but in the same there might be many reasons why the output is different, so for us to diagnose we have to have some sample input that we can debug. (If I had to give you one guess, in ffmpeg the shader didn't actually apply, because of some unexpected conversion before)
This is kind of expected depending how you made a image. You probably should just copy stream without any changes to make it work the same, command like the following will help
probably need
Hard to say really. Best if you can provide easy steps to reproduce the issue, so we can debug on our side. |
I had missed this due to all the noise, but keep in mind some shaders require specific pixel formats which means they might not trigger on RGB. |
that's how i do it -s:v 1920x1080 -r 24 -c:v libx264 -crf 0 |
That's completely different, you are re-encoding the video which entirely changes the image. The suggestion is to losslessly copy only a single frame or timeframe. If you want to do timeframes it's much easier with a program like LosslessCut imo, especially for people not too familiar with ffmpeg. |
Ok, did a little testing, it's faint without
|
no it does not change a single bit in the output frame. it's CRF=0 it's 4:4:4 predictive lossless the 4:4:4 is not the sub sampling. |
This is still occurring on b792035 |
Looks like Artoriuz is looking into fixing it. While that experiment has been removed as it has it's own issues, it did actually fix quite a few issues with clipping/thinning and maybe also colour bleeding. If it's too much of a downgrade visually I guess you could try mixing it at 50% so it's not as impactful. (I think |
Yea, it looks fixed here. |
No shaders
set glsl-shaders ~~/shaders/KrigBilateral.glsl
set glsl-shaders ~~/shaders/CfL_Prediction.glsl
set glsl-shaders ~~/shaders/CfL_Prediction_Lite.glsl
Actual badge
To repro
https://github.com/Artoriuz/glsl-chroma-from-luma-prediction/assets/18603393/dfaed0b1-79d0-44f0-b53d-52b3e6df5988<-file
The text was updated successfully, but these errors were encountered: