Selur's Little Message Board
[HELP] Can't run Cnr2 noise reduction - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html)
+--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html)
+--- Thread: [HELP] Can't run Cnr2 noise reduction (/thread-2262.html)

Pages: 1 2 3


Can't run Cnr2 noise reduction - Miranda - 31.01.2022

I've tried running the Cnr2 filter in both Avisynth and Vapoursynth, but the job never completes. I've tried re-setting filters, re-starting Hybrid and re-starting the PC.

Any help would be most appreciated.


RE: Can't run Cnr2 noise reduction - Selur - 31.01.2022

Does the same happen with the latest release version?
Does the Vapoursynth Preview show an error?

I can reproduce the issue with Avisynth, but it works fine here with Vapoursynth.

Cu Selur


RE: Can't run Cnr2 noise reduction - Miranda - 31.01.2022

Will try latest version and report back.


RE: Can't run Cnr2 noise reduction - Selur - 31.01.2022

Interessting is the Vapoursynth part since I could reproduce the Avisynth part and fixed it locally. (issue was that YUY2 needs to be converted to YV16 on output)

Cu Selur


RE: Can't run Cnr2 noise reduction - Miranda - 31.01.2022

No luck with the latest version with Vapoursynth. All I get is a blank white video file.

Colorspace issues? How do I set this up for it to run?


RE: Can't run Cnr2 noise reduction - Selur - 31.01.2022

Ah,... okay I did not check the output colors, i just checked that the queue finished.
Also uploading a dev version which should fix the Avisynth part,.. (or output the same colors there) send you a link, upload is finished in a minute or so.

Cu Selur


RE: Can't run Cnr2 noise reduction - Selur - 31.01.2022

Just checked and for me it works with the dev version.
-> if that version doesn't work for you I would need a small sample of your source to reproduce it.

Cu Selur


RE: Can't run Cnr2 noise reduction - Selur - 31.01.2022

Vapoursynth script:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/Cnr2/libcnr2.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# source: 'S:\HybridOUT\GBH-Liv-SVHS-DMR_SD-qtgmc_new.mov'
# current color space: YUV422P10, bit depth: 10, resolution: 732x564, fps: 25, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
# Loading S:\HybridOUT\GBH-Liv-SVHS-DMR_SD-qtgmc_new.mov using LWLibavSource
clip = core.lsmas.LWLibavSource(source="S:/HybridOUT/GBH-Liv-SVHS-DMR_SD-qtgmc_new.mov", format="YUV422P10", cache=0, fpsnum=25, prefer_hw=0)
# making sure input color matrix is set as 709
clip = core.resize.Bicubic(clip, matrix_in_s="709",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# adjusting color space from YUV422P10 to YUV444P8 for vsCnr2
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, range_s="limited")
# chroma denoising using VsCnr2
clip = core.cnr2.Cnr2(clip=clip, mode="oxx")
# adjusting output color from: YUV444P8 to YUV422P10 for ProResModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, range_s="limited")
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
looks correct.

Encoding call:
"C:\Program Files\Hybrid\64bit\Vapoursynth\vspipe.exe" "S:\HybridTemp\encodingTempSynthSkript_2022-01-31@17_51_37_1610.vpy" - -c y4m | "C:\Program Files\Hybrid\64bit\ffmpeg.exe" -y -noautorotate -nostdin -threads 8 -f yuv4mpegpipe -i - -an -sn -vf  scale=in_range=tv:out_range=tv -pix_fmt yuv422p10le -strict -1 -vsync 0  -vcodec prores_ks -profile:v 2 -vtag apcn -metadata encoding_tool="Hybrid 2021.12.10.1" -f mov "S:\HybridTemp\GBH-Liv-SVHS-DMR_SD-qtgmc_new_new_2022-01-31@17_51_37_1610_04.mov"
also seems correct.

Don't really see the problem from the script and calls.
Do the colors in the Vapoursynth Preview look correct and are only wrong in the output or are the colors in the Vapoursynth Preview already wrong?

Cu Selur


RE: Can't run Cnr2 noise reduction - Miranda - 31.01.2022

It seems to be running in Avisynth - fingers crossed.

I have no idea if this is the filter that I need, though - it's all trial and error with VHS captures. It runs much faster than the TemporalDenoise filter at least Smile

Thanks also for your amazing fast feedback and support, too. It's much appreciated.


RE: Can't run Cnr2 noise reduction - Selur - 31.01.2022

There seems to be some sort of color shift when passing the Vapoursynth script to ffmpeg with YV422P10, comparing the outputs through:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/Cnr2/libcnr2.dll")
# source: 'E:\Output\vapoursynth.mov'
# current color space: YUV422P10, bit depth: 10, resolution: 720x576, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading E:\Output\vapoursynth.mov using LibavSMASHSource
org = core.lsmas.LibavSMASHSource(source="G:/TestClips&Co/files/ProRes/Test Patterns Resolve 422 HQ 10-bit.mov")
org = core.resize.Bicubic(clip=org, format=vs.YUV444P8, range_s="limited")
org = core.cnr2.Cnr2(clip=org, mode="oxx")
org = core.resize.Bicubic(clip=org, format=vs.YUV422P10)
vap = core.lsmas.LibavSMASHSource(source="E:/Output/vapoursynth.mov")
avs = core.lsmas.LibavSMASHSource(source="E:/Output/avisynth.mov")
clip = core.std.StackHorizontal([org, vap,avs])

# Output
clip.set_output()
so 'filtered|Vapoursynth+Encode|Avisnth+Encode'.
[Image: vapoursynth-encoder-wrong-color.png]

Cu Selur