25.02.2021, 20:51
Will send you a link to a dev version which fixes the 'clip = clip = '-bug.
And here's an example on how to add 'FSRCNNX_x2_8-0-4-1_LineArt.glsl' between "FSRCNN_x2_r2_32-0-2.glsl" and nnedi3aa.
What I did to create the script:
No clue whether 'FSRCNN_x2_r2_32-0-2.glsl' allows additional option, but the script works fine here.
Cu Selur
And here's an example on how to add 'FSRCNNX_x2_8-0-4-1_LineArt.glsl' between "FSRCNN_x2_r2_32-0-2.glsl" and nnedi3aa.
What I did to create the script:
- I copied the 'FSRCNNX_x2_8-0-4-1_LineArt.glsl' file into the 'Hybrid\64bit\vsfilters\ResizeFilter\GLSL' (any other folder would be fine too)
- I started Hybrid
- loaded a source (resolution: 640x352)
- enable "Crop/Resize->Base->Resize"
- set "Crop/Resize->Base->Resize->Target resolution" to (width) "1280"
- enabled "Filtering->Vaporusynth->Resize->Resizer"
- selected "Filtering->Vaporusynth->Resize->Resizer->GLSL Resizer"
- selected "Filtering->Vaporusynth->Resize->Resizer->GLSL Resizer" "Hybrid/64bit/vsfilters/ResizeFilter/GLSL/FSRCNN_x2_r2_32-0-2.glsl"
- enabled "Filtering->Vaporusynth->Line->Nedi3AA"
script now looked like this:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# Import scripts
import mvsfunc
import muvsfunc
# source: 'F:\TestClips&Co\files\test.avi'
# current color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading source using FFMS2
clip = core.ffms2.Source(source="F:/TestClips&Co/files/test.avi",cachefile="E:/Temp/avi_078c37f69bb356e7b5fa040c71584c40_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",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 YUV420P8 to YUV444P16 for VsGLSLResizer
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
clip = core.placebo.Shader(clip=clip, shader="I:/Hybrid/64bit/vsfilters/ResizeFilter/GLSL/FSRCNN_x2_r2_32-0-2.glsl", width=1920, height=1056)
# Anti Aliasing using NNedia3aa
clip = muvsfunc.nnedi3aa(a=clip)
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model (i420@8)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output() - set "Filtering->Vaporusynth->Custom->Insert before" to "NNedi3AA" and enabled the custom section
- entered:
Note that there is no need to adjust the color space since it was already adjusted to YUV444P16 for FSRCNN_x2_r2_32-0-2.glsl.clip = core.placebo.Shader(clip=clip, shader="I:/Hybrid/64bit/vsfilters/ResizeFilter/GLSL/FSRCNNX_x2_8-0-4-1_LineArt.glsl", width=1920, height=1056)
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# defining beforeNNedi3AA-function - END
def beforeNNedi3AA(clip):
clip = core.placebo.Shader(clip=clip, shader="I:/Hybrid/64bit/vsfilters/ResizeFilter/GLSL/FSRCNNX_x2_8-0-4-1_LineArt.glsl", width=1920, height=1056)
return clip
# defining beforeNNedi3AA-function - END
# Import scripts
import mvsfunc
import muvsfunc
# source: 'F:\TestClips&Co\files\test.avi'
# current color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading source using FFMS2
clip = core.ffms2.Source(source="F:/TestClips&Co/files/test.avi",cachefile="E:/Temp/avi_078c37f69bb356e7b5fa040c71584c40_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",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 YUV420P8 to YUV444P16 for VsGLSLResizer
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
clip = core.placebo.Shader(clip=clip, shader="I:/Hybrid/64bit/vsfilters/ResizeFilter/GLSL/FSRCNN_x2_r2_32-0-2.glsl", width=1920, height=1056)
clip = beforeNNedi3AA(clip)
# Anti Aliasing using NNedia3aa
clip = muvsfunc.nnedi3aa(a=clip)
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model (i420@8)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
No clue whether 'FSRCNN_x2_r2_32-0-2.glsl' allows additional option, but the script works fine here.
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.