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. |
8th September 2022, 12:26 | #1 | Link |
Registered User
Join Date: Feb 2017
Posts: 134
|
Help Translating AVISynth to Vapoursynth
This is probably a no-brainer, but how do I directly translate this AVS script fragment to VS syntax?
Code:
aWarpSharp2(thresh=128, blur=2, type=0, depth=8, chroma=6) Xaa(mode="dr NNedi3",ss=1,mthr=35,mask=1,mtype="TEMmod",nns=2) dehalo_alpha(ry=1.75,rx=1.75,darkstr=0,brightstr=.8,ss=2,cs=false) |
8th September 2022, 18:06 | #2 | Link | |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Since I got a few minutes:
aWarpSharp2 -> https://github.com/dubhater/vapoursynth-awarpsharp2: Avisynth: Code:
clip = clip.aWarpSharp2(thresh=128, blur=2, type=0, depth=8, chroma=6) Quote:
Vapoursynth: Code:
clip = clip .warp.AWarpSharp2(thresh=128, blur=2, type=0) Xaa -> https://github.com/dubhater/vapoursynth-xaa Avisynht: Code:
clip = clip.Xaa(mode="dr NNedi3",ss=1,mthr=35,mask=1,mtype="TEMmod",nns=2) Code:
clip = xaa.xaa(clip = clip, mode="dr znedi3", ss=1, mthr=35, mask=1, mtype="TEdgeMask", nns=2) Avisynth: Code:
clip = clip.dehalo_alpha(ry=1.75,rx=1.75,darkstr=0,brightstr=.8,ss=2,cs=false) Vapoursynth: Code:
clip = havsfunc.DeHalo_alpha(clp=clip,rx=1.75, ry=1.75, darkstr=0, brightstr=0.8, ss=2) Cu Selur |
|
29th September 2022, 21:41 | #4 | Link |
Registered User
Join Date: Jul 2012
Location: Nottingham
Posts: 44
|
Hi Selur I was about to create a thread about the similar topic>can you please help me translating this avisynth code into vapoursynth.
Code:
src = 'video.m2ts' emask = last.tcanny(sigma=2.00, mode=1, plane=7) ymask = emask.ConvertToY8 uvmask = emask.UtoY.ConvertToY8.mt_logic(emask.VtoY.ConvertToY8, "max", Y=3, U=1, V=1).Spline36Resize(emask.width, emask.height, 0.25).mt_expand(U=1, V=1) mask = ymask.mt_logic(uvmask, "max", Y=3, U=1, V=1).ConvertToYV12 #here is what i was doing can you please help me how can i do this. Code:
src = 'video.m2ts' emask = core.tcanny.TCanny(src,sigma=2.00,mode=1,planes=[0]) ymask = emask.std.ShufflePlanes(planes=0, colorfamily=vs.GRAY) umask = emask.std.ShufflePlanes(planes=1, colorfamily=vs.GRAY) vmask = emask.std.ShufflePlanes(planes=2, colorfamily=vs.GRAY) uvmask = vshelpers.logic(umask, vmask, mode='max', planes=[]) Last edited by gugglu; 30th September 2022 at 08:49. Reason: Quote removed |
30th September 2022, 06:39 | #5 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
First thing I would usually do is convert the Avisynth script in a more readable form (hopefully I didn't make a mistake there)
Code:
src = 'video.m2ts' # HERE A LINE using a source filter is missing !! emask = last.tcanny(sigma=2.00, mode=1, plane=7) vmask = emask.VtoY vmask = vmask.ConvertToY8 uvmask = emask.UtoY uvmask = uvmask.ConvertToY8 uvmask = uvmask.mt_logic(vmask, "max", Y=3, U=1, V=1) uvmask = uvmask.Spline36Resize(emask.width, emask.height, 0.25) uvmask = uvmask.mt_expand(U=1, V=1) ymask = emask.ConvertToY8 mask = ymask.mt_logic(uvmask, "max", Y=3, U=1, V=1) mask = mask.ConvertToYV12 But looking at what you did:
Cu Selur Ps.: no clue why you quoted my previous post in total, if you post is not referring to it at all. |
30th September 2022, 21:05 | #6 | Link | |
Registered User
Join Date: Jul 2012
Location: Nottingham
Posts: 44
|
Quote:
[*]The error you get ('Expr: More expressions given than there are planes') and at the line: Code:
uvmask = vshelpers.logic(umask, vmask, mode='max', planes=[]) Code:
uvmask = vshelpers.logic(umask, vmask, mode='max', planes=[])# it is not accepting any planes [1] or [2] or [3] as umask is plane=1 and vmask is plane=2 i was trying this uvmask = vshelpers.logic(umask, vmask, mode='max', planes=[1,2]) and ending up with a error 'Expr: More expressions given than there are planes' still no luck to make it work |
|
1st October 2022, 07:46 | #7 | Link | ||
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Code:
vmask = emask.VtoY # data is in planes[0] ... uvmask = emask.UtoY # data is in planes[0] ... Quote:
Quote:
|
||
Thread Tools | Search this Thread |
Display Modes | |
|
|