xyx98 / my-vapoursynth-script

22 stars 6 forks source link

mwcfix error #1

Closed nobananasforyou closed 4 years ago

nobananasforyou commented 4 years ago

Hello.

I tried using this but I'm getting the following error:

Failed to evaluate the script: Python exception: knlm.KNLMeansCL: 'rclip' does not match the source clip!

Traceback (most recent call last): File "src\cython\vapoursynth.pyx", line 1946, in vapoursynth.vpy_evaluateScript File "src\cython\vapoursynth.pyx", line 1947, in vapoursynth.vpy_evaluateScript File "", line 16, in File "C:\Users\Yeah\AppData\Roaming\Python\Python38\site-packages\xvs.py", line 1673, in mwcfix rst_u = pp_u.knlm.KNLMeansCL(d=0, a=a, s=1, h=restore, rclip=clip_y).rgvs.Repair(pp_u, 13) File "src\cython\vapoursynth.pyx", line 1852, in vapoursynth.Function.call vapoursynth.Error: knlm.KNLMeansCL: 'rclip' does not match the source clip!

Please let me know.

Thank you!

Kiyamou commented 4 years ago

The reason for it is that your input is sub-sampling and non-16bit, such as 8bit YUV420.

At line 1647-1648 and line 1666-1667, fmtc.resample() is used, which of default output is 16bit.

https://github.com/xyx98/my-vapoursynth-script/blob/75877c86aab2218ae30a880183e45d2e4135c306/xvs.py#L1647-L1648

https://github.com/xyx98/my-vapoursynth-script/blob/75877c86aab2218ae30a880183e45d2e4135c306/xvs.py#L1666-L1667

The result of fmtc.resample() will be used as reference clip in knlm.KNLMeansCL() at line 1673-1674. It doesn't match with 8bit input.

https://github.com/xyx98/my-vapoursynth-script/blob/75877c86aab2218ae30a880183e45d2e4135c306/xvs.py#L1673-L1674

So you can convert your input to 16bit before using mwcfix().