Skip to content

v0.92 "YuruYuri Summer Vacation!+ +1"

Compare
Choose a tag to compare
@AkarinVS AkarinVS released this 15 Nov 11:10
· 33 commits to master since this release

This release introduces the CAMBI banding detector. Please see the NetFlix blog post CAMBI, a banding artifact detector for an introduction to the algorithm.

Unlike VapourSynth-VMAF, which uses libvmaf C APIs, this implementation is online (i.e. you don't have to batch process the whole clip first), and it exposes internal c-score maps (which can be used as a banding mask.) I should make it clear that this is not an independent implementation, and it's still based on code from libvmaf.

Please refer to https://github.com/AkarinVS/vapoursynth-plugin/wiki/CAMBI for its docs.

An example:

src = core.lsmas.LWLibavSource(filename)  # 8-bit or 10-bit YUV/Gray video supported
cambi = src.akarin.Cambi(scores=True)     # scores=True makes it output per-scale c-score maps in addition to the per-frame CAMBI score
cambi.text.FrameProps("CAMBI").set_output(10)
for i in range(5):
    scale = cambi.std.PropToClip('CAMBI_SCALE%d' % i)
    scale.set_output(11+i)

If you're unsure which scale to use, use cambi.std.PropToClip("CAMBI_SCALE1").fmtc.resample(scale=2) to get a rough banding mask for the input.

In case you do want to batch process the whole clip and find the top CAMBI score frames, you can do this:

from vapoursynch import core
log_file = 'cambi.log'
cambi = core.lsmas.LWLibavSource(filename).akarin.Cambi()
def append_cambi(n, f): 
    with open(log_file, 'a') as fo:
        fo.write('%d %.4f\n' % (n, f.props['CAMBI']))
    return cambi
core.std.FrameEval(cambi, append_cambi, cambi).set_output(0)

And then run the script with vspipe -p cambi.vpy -a filename=INPUT.m2ts ..
Then you can sort the output file cambi.log based on the 2nd column (i.e. sort -nr -k2,2 cambi.log if you are using Unix sort.) The first column will be the corresponding frame number.

NOTES

Due to a build error, v0.92b doesn't contain DLVFX or DLISR. v0.92c fixed the issue.
v0.92d loads DLVFX dll only when actually used, and this should fix some DLL initialization issues.
v0.92e is a test release that enables JIT caching on windows (this mainly benefits vs-preview users as it can reduce expr-heavy script reload time.)
v0.92f is a test release that incorporates a fix for #3 (so DLISR can co-exist with other cuda filters in the same script now) and actually add ** alias for pow in lexpr.