Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
23rd April 2021, 09:43 | #4281 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Yes, same procedure as every year.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
20th May 2021, 17:21 | #4283 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
We looked a bit at the mess that is mask handling recently and now I have one simple question:
Is there any script out there that actually passes a YUV clip as the mask argument of MaskedMerge and doesn't set first_plane=1? (and doesn't simply discard the output UV planes later). Code:
MaskedMerge(YUVclipA, YUVclipB, YUVmask)
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
1st June 2021, 21:27 | #4285 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
13th June 2021, 16:23 | #4286 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
Hi, I'm trying to get VSGAN running in a fresh portable Vapoursynth setup, see: https://github.com/rlaphoenix/VSGAN/issues/7
at the end I use this script: Code:
# 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/SourceFilter/FFMS2/ffms2.dll") # Import scripts import mvsfunc # source: 'G:\TestClips&Co\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="G:/TestClips&Co/test.avi",cachefile="E:/Temp/avi_9dec25d3f707eb4813d42334c7f1a8d6_853323747.ffindex",format=vs.YUV420P8,alpha=False) # adjusting color space from YUV420P8 to RGB24 for vsVSGAN clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="470bg", range_s="limited") # resizing using VSGAN from vsgan import VSGAN vsgan = VSGAN("cuda") model = "I:/Hybrid/64bit/vsgan_models/4x_BSRGAN.pth" vsgan.load_model(model) clip = vsgan.run(clip=clip) # Output clip.set_output() Code:
i:\Vapoursynth\VSPipe.exe --info C:\Users\Selur\Desktop\testvsgan.vpy - Code:
Script evaluation failed: Python exception: cannot import name 'VSGAN' from 'vsgan' (i:\Vapoursynth\Lib\site-packages\vsgan\__init__.py) Traceback (most recent call last): File "src\cython\vapoursynth.pyx", line 2242, in vapoursynth.vpy_evaluateScript File "src\cython\vapoursynth.pyx", line 2243, in vapoursynth.vpy_evaluateScript File "C:\Users\Selur\Desktop\testvsgan.vpy", line 26, in <module> from vsgan import VSGAN ImportError: cannot import name 'VSGAN' from 'vsgan' (i:\Vapoursynth\Lib\site-packages\vsgan\__init__.py) When I use the FATPACK as basis instead of using the portable Python and Vapoursynth the was I did, it does work. -> does anyone have an idea what I might have to adjust to make this work? Cu Selur |
13th June 2021, 17:06 | #4287 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
Got it working by creating a fake I:\Vapoursynth\Lib\site-packages\VapourSynth-53.dist-info folder with some fake info and uninstalling and reinstalling VSGAN I got it working!
Side note: the portable version should contain a Lib\site-packages\VapourSynth-53.dist-info-folder with proper infos. Cu Selur |
25th June 2021, 04:45 | #4288 | Link | |
Registered User
Join Date: Jun 2021
Posts: 1
|
Quote:
|
|
26th June 2021, 09:13 | #4289 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
Since my python skills aren't that high I'm not sure whether I made a mistake or this is a bug.
Using vs-placebo with shader="path to file" works fine for me, but using 'shader_s' does not. Calling: Code:
# Imports import vapoursynth as vs core = vs.get_core() # Loading Plugins core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll") core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll") # source: 'G:\TestClips&Co\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="G:/TestClips&Co/test.avi",cachefile="E:/Temp/avi_9dec25d3f707eb4813d42334c7f1a8d6_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) # GLSL filter: adaptive-sharpen.glsl # adjusting color space from YUV420P8 to YUV444P16 for VsGLSLFilter clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited") with open("I:/Hybrid/64bit/vsfilters/GLSL/adaptive-sharpen.glsl") as glslf: glsl = glslf.read() glsl = glsl.replace('#define curve_height 1.0', '#define curve_height 2.0'); clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=640, height=352) # adjusting output color from: YUV444P16 to YUV420P10 for x265Model (i420@8) clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited") # set output frame rate to 25.000fps clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1) # Output clip.set_output() Code:
Failed to evaluate the script: Python exception: Shader: Function does not take argument(s) named shader_s Traceback (most recent call last): File "src\cython\vapoursynth.pyx", line 2242, in vapoursynth.vpy_evaluateScript File "src\cython\vapoursynth.pyx", line 2243, in vapoursynth.vpy_evaluateScript File "C:\Users\Selur\Desktop\test.vpy", line 23, in <module> clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=640, height=352) File "src\cython\vapoursynth.pyx", line 2040, in vapoursynth.Function.__call__vapoursynth.Error: Shader: Function does not take argument(s) named shader_s Code:
placebo.Shader(clip clip, [string shader, int width, int height, int chroma_loc = 1, int matrix = 2, int trc = 1, string filter = "ewa_lanczos", float radius, float clamp, float taper, float blur, float param1, float param2, float antiring = 0.0, int lut_entries = 64, float cutoff = 0.001, bool sigmoidize = 1, bool linearize = 1, float sigmoid_center = 0.75, float sigmoid_slope = 6.5, string shader_s]) Cu Selur Ps.: I also posted this to the vs-placebo github issue tracker (https://github.com/Lypheo/vs-placebo/issues/12). |
26th June 2021, 10:02 | #4290 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
Okay, that got solved, only master contained the shader_s-path not the current (1.1.0) release,..
-> if someone got a build environment for this would be nice if he could build and share a current 64bit Windows build of VSGAN Last edited by Selur; 26th June 2021 at 11:05. |
27th June 2021, 14:18 | #4291 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
anyone wants a general remap filter?
Code:
clip = core.std.Remap(clip, lambda y, x: [clip.height - y - 1, x]) # equivalent to FlipVertical clip = core.std.Remap(clip, lambda y, x: [y, clip.width - x - 1]) # equivalent to FlipHorizontal clip = core.std.StackVertical([clip, clip]) clip = core.std.StackHorizontal([clip, clip]) clip = core.std.Remap(clip, lambda y, x: [y // 2, x // 2]) # equivalent to 2x upscale by point resize |
27th June 2021, 14:27 | #4292 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
10th July 2021, 18:28 | #4293 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
hi, I'm trying to convert the Avisynth function:
Code:
function filldrops(clip c, float "thresh") { thresh = default(thresh, 0.1) super=MSuper(c,pel=2) vfe=MAnalyse(super,truemotion=true,isb=false,delta =1) vbe=MAnalyse(super,truemotion=true,isb=true,delta= 1) filldrops = MFlowInter(c,super,vbe,vfe,time=50) fixed = ConditionalFilter(c, filldrops, c, "YDifferenceFromPrevious()", "lessthan", String(thresh)) return fixed } to Vapoursynth, and got: Code:
def filldrops(c, thresh=0.1) def YDifferenceFromPrevious(n, f, clips): if f.props['_SceneChangePrev']: return clips[0] else: return clips[1] super=core.mv.Super(clip=c,pel=2) vfe=core.mv.Analyse(clip=super,truemotion=true,isb=false,delta =1) vbe=core.mv.Analyse(clip=super,truemotion=true,isb=true,delta= 1) filldrops = core.mv.FlowInter(clip=c,super,mvbw=vbe,mvfw=vfe,time=50) #fixed = ConditionalFilter(c, filldrops, c, "YDifferenceFromPrevious()", "lessthan", String(thresh)) fixed = core.std.FrameEval(...) return fixed -> can someone tell me how FrameEval(...) should look like to do what ConditionalFilter(...) does ? Thanks! Cu Selur Last edited by Selur; 10th July 2021 at 18:51. |
11th July 2021, 15:45 | #4294 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Code:
def filldrops(c, thresh=0.1) diffclip = core.std.PlaneStats(c, c[0] + c) super=core.mv.Super(clip=c,pel=2) vfe=core.mv.Analyse(clip=super,truemotion=true,isb=false,delta =1) vbe=core.mv.Analyse(clip=super,truemotion=true,isb=true,delta= 1) filldrops = core.mv.FlowInter(clip=c,super,mvbw=vbe,mvfw=vfe,time=50) def selectFunc(n, f): if f.props['PlaneStatsDiff'] < thresh: return c else: return filldrops fixed = core.std.FrameEval(c, selectFunc, prop_src=diffclip) return fixed
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
16th July 2021, 12:36 | #4297 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
R54-RC1
This release makes the handling of floating point masks consistent (now always 0-1 range, even for UV planes) and fixes some other minor bugs. Should be a very stable build overall. Code:
r54: updated visual studio 2019 runtime version updated zimg to 3.0.2 cliptoprop now uses the length of the second clip instead of the first one added sin and cos operator to the expr filter (AkarinVS) made handling of floating point masks consistent (AkarinVS and more) fixed memory leak on free in expr filter on linux (AkarinVS)
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
16th July 2021, 21:57 | #4299 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
An option to disable auto loading is probably coming soon. With more exciting things as well.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
Tags |
speed, vaporware, vapoursynth |
Thread Tools | Search this Thread |
Display Modes | |
|
|