AkarinVS / vapoursynth-plugin

My experimental VapourSynth plugin: (1) an enhanced LLVM-based std.Expr (aka lexpr), Select, PropExpr, Text and Tmpl. (2) DLISR. (3) DLVFX (4) CAMBI.
GNU Lesser General Public License v3.0
37 stars 8 forks source link

CAMBI usage #10

Closed LuisB79 closed 2 years ago

LuisB79 commented 2 years ago

Can CAMBI be used with f3dkneo or other debanding filters?

AkarinVS commented 2 years ago

CAMBI itself is just a banding detection filter. It gives a score on how much banding it can detect in the frame (and optionally also give a few banding intensity maps that you can indeed use as a mask for debanding filters like f3kdb and the like.)

LuisB79 commented 2 years ago

CAMBI itself is just a banding detection filter. It gives a score on how much banding it can detect in the frame (and optionally also give a few banding intensity maps that you can indeed use as a mask for debanding filters like f3kdb and the like.)

If possible, could you provide a working example for the uninitiated?

AkarinVS commented 2 years ago

https://github.com/AkarinVS/vapoursynth-plugin/wiki/CAMBI

LuisB79 commented 2 years ago

Ok so from what i got from that i need to convert the vid to grayscale yuv and it only supports either 8 or 10 bit, i did not understood the window_size, topk, tvi_threshold, scores and scaling, or how changing those affects CAMBI, there is no example of data provided that could be translated into a mask for debanding filters (when CAMBI runs, what kind of data do i expect, and how can i use it as a mask?), could you elaborate further on that?, i am truly a beginner with vapoursynth and filter editing, i don't even know how to create a mask or how does it works with a debanding filter.

AkarinVS commented 2 years ago

I'm afraid you will have to do some experiments to understand what does those parameter affect the CAMBI score. Read netflix blog https://netflixtechblog.com/cambi-a-banding-artifact-detector-96777ae12fe2 and libvmaf docs. Generally speaking, you don't need to tweak window_size, topk, tvi_threashold to use cambi.

I have already provided some ready to run examples in the wiki page. Try the example https://github.com/AkarinVS/vapoursynth-plugin/wiki/CAMBI#example-usage on a video and look at the output 10/11/12... what do you see? output 10 should show the cambi score for the frame at the upper left corner. output 11 and beyond are the cambi banding intensity masks.

Perhaps you might find vapoursynth and mask tutorial useful. It's really hard to write down how to use cambi masks with debanding filters in a few paragraphs.

LuisB79 commented 2 years ago

Seeing how complex are these topics, if possible, could you make a plugin that combines CAMBI and f3dkneo to automatically deband videos with good quality?

NSQY commented 2 years ago

This already exists as a function.

https://github.com/Setsugennoao/stgfunc/blob/master/stgfunc/deband.py#L48

LuisB79 commented 2 years ago

This already exists as a function.

https://github.com/Setsugennoao/stgfunc/blob/master/stgfunc/deband.py#L48

it's not properly documented, how would someone new into VS would even use this?.