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. |
12th April 2015, 16:26 | #102 | Link |
Registered User
Join Date: Jul 2010
Location: Germany
Posts: 357
|
The first version is the short form of
Code:
last = Crop(last, 0, 10, 0, -10) last = Spline64Resize(last, 1280, 720) Code:
last = Spline64Resize(Crop(last, 0, 10, 0, -10), 1280, 720) Code:
Version PointResize(Width * 2, Height * 2) PointResize(Width / 2, Height / 2) Result_1 = last Version PointResize(Width * 2, Height * 2).PointResize(Width / 2, Height / 2) Result_2 = last Expanded to its full form the example looks like this: Code:
a = Version b = PointResize(a, a.Width * 2, a.Height * 2) c = PointResize(b, b.Width / 2, b.Height / 2) Result_1 = c d = Version e = PointResize(PointResize(d, d.Width * 2, d.Height * 2), d.Width / 2, d.Height / 2) Result_2 = e Code:
BilinearResize(int(Width * 0.75), int(Height * 0.75)).BilinearResize(Width, Height) Last edited by creaothceann; 12th April 2015 at 16:41. |
16th October 2017, 21:52 | #104 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
You're probably using an older version of AVS+ that does not have that function. Update to the latest version (r2508).
__________________
Groucho's Avisynth Stuff |
17th October 2017, 15:13 | #106 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
I think last posts should move to https://forum.doom9.org/showthread.php?t=174120
__________________
See My Avisynth Stuff |
26th December 2017, 07:25 | #107 | Link |
Registered User
Join Date: Nov 2016
Posts: 12
|
Q : is there a way to enumerate variables in avs ?
I'm trying to do something similar to the following batch script : Code:
set /a count=1 set var=video%count% echo the resulting var is "video1" set /a count+=1 echo we add 1 to the initial count so it's now 2 echo then we set the var gain set var=video%count% echo the var is now "video2" pause
__________________
AviSynth+ Fansub Edition Last edited by ilko; 26th December 2017 at 07:27. |
26th December 2017, 10:39 | #108 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
RT_Stats:- https://forum.doom9.org/showthread.p...light=RT_Stats
Code:
RT_VarExist(string) Given the name (string) of the variable that you want to test for existence, returns true if exists, else false. Eg, #a=32 RT_Debug(string(RT_VarExist("a"))) # would output 'false' to debugview unless '#a=32' uncommented. {Defined(a) would fail with error}. return colorbars() EDIT: Code:
Function VarType(String GlobalName) { Try { g = Eval(GlobalName) # Fail here if not exist res= g.IsBool ? 1 \ : g.IsInt ? 2 \ : g.IsFloat ? 3 \ : g.IsString ? 4 \ : g.IsClip ? 5 \ : 0 } Catch (msg) { res = 0 # Not Exist } return res } Function VarTypeName(Int TypIx) {Assert(0 <= Typix <= 5,"VarTypeName: Bad Typix") Return Select(TypIx,"NOT_EXIST","Bool","Int","Float","String","Clip")} Global G_i = 666 # Comment Me Out Type = VarType("G_i") TypeName=VarTypeName(Type) MessageClip("Global G_i Type = "+String(Type) + " : TypeName='"+TypeName+"'") EDIT: RT_VarExist just returns result of an Avisynth function, would do equivalent of VarExist on local of that name, and if failed then on Global of that name. We cant test locals in script within a separate function, you would need to inline script try/catch in-situ if required for local. EDIT: Something like Code:
Try {Dummy=Eval(LocalName) LocalExist=True} Catch(msg) {LocalExist=False} # Dummy, avoid assign anything to Last
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 26th December 2017 at 11:29. |
18th April 2018, 08:04 | #109 | Link |
Registered User
Join Date: Apr 2018
Posts: 5
|
Was looking through the guides and the wiki and seemed to find that the Force Film, IVTC, and Deinterlacing tutorial link seems to be dead. Does anyone have a zip file of it? It looks like its the main tutorial that I need for my current situation.
|
29th August 2018, 18:34 | #110 | Link |
Registered User
Join Date: Sep 2010
Location: Russia
Posts: 85
|
Do we have a definitive guide for MVTools options that does a better job at explaining what the more obscure settings do than the official page? I'm particularly interested in what typical situations the options like divide, trymany, temporal, rfilter and so on should be used.
You'd think after all this time somebody would have done a proper analysis and comparison the way they're done for videocodecs. For example, by taking a source video, halving its framerate then upsampling it back and comparing with the original using tools like MSU VQM or other stuff with metrics like PSNR. This is the way I'm trying to do it, but there's only so much you can derive from metrics you don't know comparing options you don't understand. For example I was surprised to find out that a combination of block size 32 and truemotion=true gives results a lot worse than most other combinations of sizes and values. Another counter-intuitive discovery was that the search method 3 (which is claimed to be similar to x264's ESA) is actually faster and not better than 5 (UMH). What options should be tweaked first when dealing with 2K video with lots of flickering? I'm under the impression that most of Avisynth's filters were written in the DVD era and might have SD resolution dependency hardcoded in one way or another somewhere. |
29th April 2019, 07:49 | #112 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
|
Quote:
I think that you can achieve something like this by using a decent upscaling kernel yourself, especially in combination with NNEDI and 16bit precision to get better results. Start with something like: Code:
nnedi3_rpow2(cshift="Spline64Resize", rfactor=2, fwidth=1920, fheight=1080, nsize=4, nns=4, qual=1, etype=0, pscrn=2, threads=0, csresize=true, mpeg2=true, threads_rs=0, logicalCores_rs=true, MaxPhysCore_rs=true, SetAffinity_rs=false, opt=3) If you want more precision, you can use: Code:
nnedi3_resize16(target_width=1920, target_height=1080, mixed=true, thr=1.0, elast=1.5, nns=4, qual=2, etype=0, pscrn=4, threads=0, tv_range=true, kernel_d="Spline", kernel_u="Spline", taps=6, f_d=1.0, f_u=2.0, sharp=0, lsb_in=true, lsb=true) Cheers, Frank. |
|
16th May 2019, 07:28 | #113 | Link | |
Registered User
Join Date: Nov 2017
Posts: 154
|
Quote:
|
|
4th September 2019, 08:02 | #116 | Link | |
Registered User
Join Date: Nov 2017
Posts: 154
|
Quote:
Sent from my LG-M700 using Tapatalk |
|
4th September 2019, 10:03 | #117 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
4th September 2019, 11:07 | #118 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
you could try this
Code:
# SomeLogo.avs # with Avisynth installed, play avs in most any player except VLC. # ie, get it working BEFORE try use in MeGUI Colorbars(Pixel_Type="YV12").KillAudio # Testing subtstitute for your source video clip as YV12, ie delete line or comment out [insert '#' before line] #AviSource("D:\Parade.avi").ConvertToYV12 I=ImageSource(".\Imagemagick-logo.png",END=0) # Your Logo in current directory (or specify path) ##### CONFIG ##### I_Width = 128 # Your required width of Logo, multiple of 2 I_HEIGHT = 96 # Your required Height of Logo, multiple of 2 LOGO_X = -20 # Logo X position LOGO_Y = -20 # Logo Y position RGT_REL = True # If True then LOGO_X adjusts right aligned, ie LOGO_X=0 is hard against Right hand side) BOT_REL = True # If True then LOGO_Y adjusts Bottom aligned, ie LOGO_Y=0 is hard against bottom) OPACITY = 0.5 # 0.0 -> 1.0, 0.0=NO LOGO, 1=ALL LOGO START_FRAME = 25 END_FRAME = 100 # 0 = Do Till End of clip ### END CONFIG ### Assert(I_WIDTH%2==0 &&I_HEIGHT%2==0,"SomeLogo: I_Width and I_Height have to be multiple of 2") I=(I.Width!=I_WIDTH || I.Height != I_HEIGHT) ? I.Spline36Resize(I_WIDTH,I_HEIGHT) : I # Resize to required I=I.ConvertToYV12 # Same As Source clip END_FRAME = (END_FRAME==0) ? Framecount-1 : END_FRAME LOGO_X = (RGT_REL) ? (Width -I.Width + LOGO_X) : LOGO_X LOGO_Y = (BOT_REL) ? (Height-I.Height + LOGO_Y) : LOGO_Y MASK=I.BlankClip(Color_YUV=$FF8080) # Solid White (just dummy for ApplyRange really) (START_FRAME==0 && END_FRAME==FrameCount-1) \ ? Last.Overlay(I,x=LOGO_X,y=LOGO_Y,Opacity=OPACITY) \ : Last.ApplyRange(START_FRAME,END_FRAME,"Overlay",I,LOGO_X,LOGO_Y,MASK,OPACITY) #return last.info # Uncomment for TESTING EDIT: Mod Code:
# SomeLogo.avsi # Put in Avisynth Plugins AND MeGUI Plugins (NOTE, AVSI) Function SomeLogo(clip c,clip Img,Int "I_Width",Int "I_Height",Int "Logo_X",Int "Logo_Y",Bool "Rgt_Rel",Bool "Bot_Rel",Float "Opacity",Int"Start_Frame",Int "End_Frame") { c # Last = c I_Width = Default(I_Width, img.Width) # Default original Image Width I_Height = Default(I_Height,img.Height) # Default original Image Height Logo_X = Default(Logo_X,0) # Default 0 Logo_Y = Default(Logo_Y,0) # Default 0 Rgt_Rel = Default(Rgt_rel,False) # Default False bot_Rel = Default(bot_rel,False) # Default False Opacity = Default(Opacity,1.0) # Default 1.0, ALL image Start_Frame = Default(Start_Frame,0) # Default frame 0 End_Frame = Default(End_Frame,0) # Default 0 = LAST FRAME Assert(I_WIDTH%2==0 &&I_HEIGHT%2==0,"SomeLogo: I_Width and I_Height have to be multiple of 2") Img=(Img.Width!=I_WIDTH || Img.Height != I_HEIGHT) ? Img.Spline36Resize(I_WIDTH,I_HEIGHT) : Img # Resize to required Img=Img.ConvertToYV12 # Same As Source clip END_FRAME = (END_FRAME==0) ? Framecount-1 : END_FRAME LOGO_X = (RGT_REL) ? (Width -Img.Width + LOGO_X) : LOGO_X LOGO_Y = (BOT_REL) ? (Height-Img.Height + LOGO_Y) : LOGO_Y MASK=Img.BlankClip(Color_YUV=$FF8080) # Solid White (just dummy for ApplyRange really) (START_FRAME==0 && END_FRAME==FrameCount-1) \ ? Last.Overlay(Img,x=LOGO_X,y=LOGO_Y,Opacity=OPACITY) \ : Last.ApplyRange(START_FRAME,END_FRAME,"Overlay",Img,LOGO_X,LOGO_Y,MASK,OPACITY) Return Last } # END SomeLogo.avsi # For initial testing, can have above function in this test script, when move above to avsi in plugins, then remove above from this script. # Your script calling the function in plugins [ someLogo.avsi : SomeLogo() ] # with Avisynth installed, play avs in most any player except VLC. # ie, get it working BEFORE try use in MeGUI Colorbars(Pixel_Type="YV12").KillAudio # Testing subtstitute for your source video clip as YV12, ie delete line or comment out [insert '#' before line] #AviSource("D:\Parade.avi").ConvertToYV12 Img=ImageSource(".\Imagemagick-logo.png",END=0) # Your Logo in current directory (or specify path) ##### CONFIG ##### I_Width = 128 # Your required width of Logo, multiple of 2 I_HEIGHT = 96 # Your required Height of Logo, multiple of 2 LOGO_X = -20 # Logo X position LOGO_Y = -20 # Logo Y position RGT_REL = True # If True then LOGO_X adjusts right aligned, ie LOGO_X=0 is hard against Right hand side) BOT_REL = True # If True then LOGO_Y adjusts Bottom aligned, ie LOGO_Y=0 is hard against bottom) OPACITY = 0.5 # 0.0 -> 1.0, 0.0=NO LOGO, 1=ALL LOGO START_FRAME = 25 END_FRAME = 100 # 0 = Do Till End of clip ### END CONFIG ### SomeLogo(Img,I_Width=I_WIDTH,I_Height=I_HEIGHT,Logo_X=LOGO_X,Logo_Y=LOGO_Y,Rgt_Rel=RGT_REL,Bot_Rel=BOT_REL,Opacity=OPACITY,Start_Frame=START_FRAME,End_Frame=END_FRAME) #SomeLogo(Img,128,96,Opacity=0.5,Start_Frame=25,End_Frame=100) # Logo_X, Logo_Y,Rgt_Rel, Bot_rel, ALL DEFAULT ::: ALL CONFIG part can be missed out #SomeLogo(Img,128,96,-20,-20,true,true,0.5,0,100) # ALL CONFIG part can be missed out #return last.info # Uncomment for TESTING Code:
Colorbars(Pixel_Type="YV12").KillAudio # Testing subtstitute for your source video clip as YV12, ie delete line or comment out [insert '#' before line] Img=ImageSource(".\Imagemagick-logo.png",END=0) # Your Logo in current directory (or specify path) SomeLogo(Img,128,96,-20,-20,true,true,0.5,0,100) # ALL CONFIG part can be missed out #SomeLogo(Img,I_Width=128,I_Height=96,Logo_X=-20,Logo_Y=-20,Rgt_Rel=True,Bot_Rel=True,Opacity=0.5,Start_Frame=0,End_Frame=100) # ALL CONFIG part can be missed out
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 5th September 2019 at 14:59. |
5th September 2019, 14:32 | #120 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
VDX, Think that is best in realm of Groucho2004 SysInfo plug [if/when implemented], G2K4 has code to get real path to system32/sysWOW64, and I think it was a bit tricky to achieve
as system tries to make everything [x86 or x64] seem to appear in system32. (Of course it may not even be in system32, could be in eg MeGUI folder or whatever). Maybe ask G2K4 bout it, he's a nice fella and if you beg sufficiently well [bit of praise also works I hear], then maybe he do it. [EDIT: Refer to him as "My Leader", I believe he likes that] EDIT: Also note, RT_Stats GetSystemEnv thing (or other GetSystemEnv type plugs) for eg "COMSPEC" return path to eg "d:\Windows\system32\Cmd.exe", as that is how is set in system environment, even though it may really be in sysWOW64. So, if you need real path, G2K4 is the man that can.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 5th September 2019 at 15:23. |
Tags |
avisynth, faq |
|
|