Closed Zabooby closed 1 year ago
I am currently using this script which cycles through lavfi's denoise filters, how does nlmeans compare?
NLM is supposed to be one of the better denoising algorithms, and in addition my shaders implement many extensions to the algorithm. So it should compare very well, but I haven't directly compared it to the ffmpeg filters (besides the NLM filter, initially nlmeans.glsl
was just supposed to be a port of that filter). I encourage you to run it for yourself and form your own opinion.
In the future I want to showcase output from the shaders in the readme, maybe I should include comparisons to the ffmpeg filters too.
Similar to how the script above cycles filters by continuously pressing one key, what line would I put in my input.conf to cycle between the default, medium and heavy nlmeans shaders?
You can check out my shader keybinds here. I don't have it set up to cycle exactly, each shader is assigned to a different key. I plan to make a script (already started on it, but I'm focusing on other stuff right now) to select shaders more easily, so keep an eye out for that.
By the way, the heavy profile is not really practical on real video since it removes a copious amount of detail, I will probably remove it in the future. If the default profile doesn't suffice, then the medium profile should be appropriate.
Thanks for the detailed response, I will definitely check out the default and medium filters!
I'll also keep an eye out for the script too and I'll do some digging to find how to cycle shaders.
2 more questions:
Thanks for the detailed response, I will definitely check out the default and medium filters!
Awesome, let me know how it goes!
If I'm after the best quality, would it be better to use your sharpening variant or your normal denoise filter with a dedicated sharpening shader like the ones listed here (from my config).
You can try both ways and see what you prefer. I used to use NLM+FSR before implementing sharpening, it's really not bad. But in my (biased) opinion NLM's sharpening effect is very pleasing and I highly prefer it over everything else. It's very noise resistance by nature, so you can get more sharpness out of it before the image gets crunchy.
Ok, I'll give the sharpening variant a spin too, will report back later.
Awesome, let me know how it goes!
After some testing and comparisons I've decided to use nlmeans_hqx.glsl
and nlmeans_hq_medium.glsl
, imo they work better than the lavfi filters, thanks for the help!
Also found how to cycle between them with the help of ChatGPT using:
n cycle-values glsl-shaders "~~/shaders/nlmeans_hqx.glsl" "~~/shaders/nlmeans_hq_medium.glsl" "change-list glsl-shaders clr all"
I just pushed a commit that greatly improves the sharpening effect, try it out and let me know what you think!
It's definitely an improvement, but IMO using a dedicated sharpener still gives better results.
I plan to make a script (already started on it, but I'm focusing on other stuff right now) to select shaders more easily, so keep an eye out for that.
https://github.com/AN3223/dotfiles/blob/master/.config/mpv/scripts/pickshader.lua
@AN3223 Am I blind or did you remove the medium variant?
For your deband shader does it only make sense to use when debanding is quite noticeable (small file sizes/low bitrate/youtube videos), otherwise using mpv's built-in debanding for everything else?
How does your sharpen only shader compare to other popular sharpening shader like adaptive sharpen, cas and nvidia sharpen?
I understand the temporal variant is still experimental, but how does it compare to the HQX variant, what does it do differently?
@AN3223 Am I blind or did you remove the medium variant?
Yes it's removed for now. I explained this better in the commit history but pretty much the current nlmeans.glsl
has the same parameter change that the medium profile was using. In the future I will test against higher noise levels but it's low priority right now.
For your deband shader does it only make sense to use when debanding is quite noticeable (small file sizes/low bitrate/youtube videos), otherwise using mpv's built-in debanding for everything else?
I don't use mpv's built-in debanding at all. I use the LQ hdeband by default and if something is heavily banded then I will use the regular hdeband.
How does your sharpen only shader compare to other popular sharpening shader like adaptive sharpen, cas and nvidia sharpen?
It's noise resistant, so tries its best to not amplify noise. I also recently added anti-ringing, which is a feature all of the other sharpeners have, it basically reduces sharpening in already sharp areas. Use your eyeballs and see if you like it.
I understand the temporal variant is still experimental, but how does it compare to the HQX variant, what does it do differently?
Temporal looks at previous frames in addition to the current frame. It's buggy though. In theory, if it were working properly, it would offer much better quality since noise tends to disappear after a single frame but image details tend to stay for multiple frames, which should make it much easier to separate noise from detail.
Yes it's removed for now. I explained this better in the commit history but pretty much the current
nlmeans.glsl
has the same parameter change that the medium profile was using. In the future I will test against higher noise levels but it's low priority right now.
Any updates on the medium variant, if not which lines of the hgx shader should I change to tune it for lower noise levels?
I say lower noise levels as the parameters for the medium variant (tuned for higher noise levels) where moved to the current nlmeans.glsl
.
Sorry for the confusion, the current configs are still tuned for the same noise level as before. Do you really want configs that are tuned for lower noise levels?
You're right, I probably don't need to tune for lower noise levels, nvm.
How does the new ffmpeg_eqv shader differ from the nlmeans hqx variant. Does it require less compute power or higher/lower denoising strength, etc.
What would be the use case if nlmeans is already the better denoising algorithm (imo) compared to the ffmpeg filters?
How does the new ffmpeg_eqv shader differ from the nlmeans hqx variant. Does it require less compute power or higher/lower denoising strength, etc.
It's unrelated to HQX, I just put it in that directory so no one with a weak GPU would be tempted to run it and freeze their system. But now that I think about it, it really doesn't belong in that directory, I'll move it back to the experimental directory.
What would be the use case if nlmeans is already the better denoising algorithm (imo) compared to the ffmpeg filters?
There's not much purpose, it's mostly there as a sanity check to make sure nothing is horribly broken. I thought it might be useful in some use case where someone needs a drop-in replacement for ffmpeg's nlmeans, but now I think that seems very niche.
Do you plan to make a hgx version for the new light variant?
No, actually I plan to remove HQX. It's not properly maintained and it would take more time than it's worth to maintain it. You'll get better quality from HQ.
Came across this discussion (use Google Translate extension to read in english) comparing hdeband with mpv's built in debanding. One comment said hdeband performs better under normal levels of debanding while mpv's performs better under more extreme debanding. I've had similar results myself.
Thoughts?
Thanks for pointing this out. This sounds like it might be a reasonable observation for some content. hdeband has some issues, one of them being that it can't handle sharp changes in intensity very well (I think this is likely what is being observed in that discussion). I plan to do testing on it the same way I do with NLM, and then I have a couple of ideas that may or may not help.
I am currently using this script which cycles through lavfi's denoise filters, how does nlmeans compare?
Similar to how the script above cycles filters by continuously pressing one key, what line would I put in my input.conf to cycle between the default, medium and heavy nlmeans shaders?