Log in

View Full Version : AviSynth Q&A


Pages : 1 2 [3] 4 5

ale_x
17th October 2017, 10:40
You're probably using an older version of AVS+ that does not have that function. Update to the latest version (r2508).

Thank u very much =).

real.finder
17th October 2017, 15:13
I think last posts should move to https://forum.doom9.org/showthread.php?t=174120

ilko
26th December 2017, 07:25
Q : is there a way to enumerate variables in avs ?

I'm trying to do something similar to the following batch script :
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

StainlessS
26th December 2017, 10:39
RT_Stats:- https://forum.doom9.org/showthread.php?t=165479&highlight=RT_Stats


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()


Could also simulate (for Globals) with Try/Catch in script (within a function, and return as result).

EDIT:


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+"'")

EDITED:

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

Try {Dummy=Eval(LocalName) LocalExist=True} Catch(msg) {LocalExist=False} # Dummy, avoid assign anything to Last

ShogunGino
18th April 2018, 08:04
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.

Seedmanc
29th August 2018, 18:34
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.

imsrk48
28th April 2019, 06:30
I want to learn about this plugin more better

http://www.infognition.com/super_resolution_avisynth/

FranceBB
29th April 2019, 07:49
I want to learn about this plugin more better

http://www.infognition.com/super_resolution_avisynth/

According to the comparison screenshots they posted on their websites, it looks like a decent upscaling kernel vs PointResize.

https://i.imgur.com/eJNozWF.png

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:


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)


for 8bit.
If you want more precision, you can use:


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)


It will use more taps for Spline so it will be very sharp, but it will also try to preserve edges and avoid ringing and aliasing thanks to the trained neural netowk; it's also gonna work with 16bit precision and since it works in 16bit stacked, it's compatible with the normal Avisynth 2.6.1 from 2016.

Cheers,
Frank.

imsrk48
16th May 2019, 07:28
According to the comparison screenshots they posted on their websites, it looks like a decent upscaling kernel vs PointResize.

https://i.imgur.com/eJNozWF.png

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:


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)


for 8bit.
If you want more precision, you can use:


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)


It will use more taps for Spline so it will be very sharp, but it will also try to preserve edges and avoid ringing and aliasing thanks to the trained neural netowk; it's also gonna work with 16bit precision and since it works in 16bit stacked, it's compatible with the normal Avisynth 2.6.1 from 2016.

Cheers,
Frank.Thanks a Lot [emoji4]

imsrk48
25th May 2019, 12:14
Please suggest me script for add .png logo on a video.

imsrk48
4th September 2019, 08:00
Please suggest me script for add .png logo on a video.Anyone Answer Please [emoji120]

Sent from my LG-M700 using Tapatalk

imsrk48
4th September 2019, 08:02
According to the comparison screenshots they posted on their websites, it looks like a decent upscaling kernel vs PointResize.

https://i.imgur.com/eJNozWF.png

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:


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)


for 8bit.
If you want more precision, you can use:


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)


It will use more taps for Spline so it will be very sharp, but it will also try to preserve edges and avoid ringing and aliasing thanks to the trained neural netowk; it's also gonna work with 16bit precision and since it works in 16bit stacked, it's compatible with the normal Avisynth 2.6.1 from 2016.

Cheers,
Frank.How Can I Use This in MeGUI?

Sent from my LG-M700 using Tapatalk

StainlessS
4th September 2019, 10:03
How Can I Use This in MeGUI?
Learn how to use Avisynth, then most of your requests could be done by yourself.

StainlessS
4th September 2019, 11:07
Please suggest me script for add .png logo on a video.

you could try this


# 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

# 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


EDIT: So with SomeLogo.avsi in plugins, can use just like so:-

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

VoodooFX
5th September 2019, 02:44
Is it possible to get path to avisyth.dll in use from avs script? Maybe invoke some error with try and catch?

StainlessS
5th September 2019, 14:32
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.

Groucho2004
5th September 2019, 17:23
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]Don't forget that I require a goat to be sacrificed before I start writing code.

@VoodooFX
I'll probably add that to the SysInfo() plugin.

VoodooFX
5th September 2019, 20:36
I was thinking about some trick without external plugin.
I have seen on other forums newbies have problems with standalone MeGUI's avs+ not auto-loading ImageSeq.dll, error is not very clear what is wrong. I'll just catch that and assert with more clear msg then.
Requesting them to get more plugins not good idea. :)

Groucho2004
5th September 2019, 22:06
I was thinking about some trick without external plugin.
I have seen on other forums newbies have problems with standalone MeGUI's avs+ not auto-loading ImageSeq.dll, error is not very clear what is wrong. I'll just catch that and assert with more clear msg then.
Requesting them to get more plugins not good idea. :)
It's not possible as far as I know without some code that digs into the parent process and enumerates loaded modules.

As for megui's "portable" mode and plugins that were externalized in AVSPlus - I don't understand how this is even a problem, it seems ridiculous.

imsrk48
7th October 2019, 04:39
you could try this


# 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

# 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


EDIT: So with SomeLogo.avsi in plugins, can use just like so:-

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
Thanks a Lot [emoji4] and sorry for not replied

eobard
15th October 2019, 23:32
Is there a mirror of avisynth.nl? The site is down

StainlessS
16th October 2019, 02:50
Its up now.

imsrk48
21st November 2019, 10:46
i want to learn avisynth where i can start?

l00t
21st November 2019, 10:58
i want to learn avisynth where i can start?

http://avisynth.nl/index.php/Main_Page

-> New to AviSynth - Start here

imsrk48
21st November 2019, 11:32
http://avisynth.nl/index.php/Main_Page



-> New to AviSynth - Start hereThanks a Lot [emoji4]

imsrk48
24th December 2019, 14:06
i would like to ask can avisynth increase video quality or 240p video to 720p with some scripts?

https://tune.pk/video/7484297/hatim-episode-1

FranceBB
24th December 2019, 17:16
i would like to ask can avisynth increase video quality or 240p video to 720p with some scripts?

https://tune.pk/video/7484297/hatim-episode-1

Upscaling won't increase video quality as you can't create pixels out of nowhere.
Anyway, there are good upscaling kernels that can upscale a source quite nicely like Spline64 which you can use together with NNEDI.
Please note that - as I said - although you are gonna have more pixels, you won't have more definition as those new pixels are just gonna be "fake". Some argue that upscaling doesn't bring any benefit at all and it's just a waste of space, but on the other hand some other people argue that sometimes it's worth upscaling as it's better to do it with Avisynth than to let the TV or the player do it with something crappy like a FastBilinear. As to your source, it seems to be starved which basically means that whoever encoded it did it at a very low bitrate thus removing important details.
With a source like this, upscaling is the LAST thing I would do.
If you really wanna re-encode it, just do deblocking with Deblock_QED() or the built-in deblocker of x264/x265 if you're planning to re-encode it in H.264/H.265 and a bit of denoise with dfttest(). It will look flat, but at least you won't have macroblocks and ringing everywhere.



By the way...

You linked a streaming website that I don't know, but I highly doubt that it's legal, so if it isn't, moderators will remove your link and you won't receive any further help as piracy is forbidden!

I just did a google search of the series and the first thing I found is a website with the DVDs of the series you linked. I strongly suggest you to get the official DVDs which are gonna be a relatively high bitrate MPEG-2 encodes at 720x480i which are far better than the crappy starved 240p source you linked.

StainlessS
24th December 2019, 18:07
+1 for what FranceBB said, tis truly garbage.

imsrk48
24th December 2019, 19:06
Upscaling won't increase video quality as you can't create pixels out of nowhere.
Anyway, there are good upscaling kernels that can upscale a source quite nicely like Spline64 which you can use together with NNEDI.
Please note that - as I said - although you are gonna have more pixels, you won't have more definition as those new pixels are just gonna be "fake". Some argue that upscaling doesn't bring any benefit at all and it's just a waste of space, but on the other hand some other people argue that sometimes it's worth upscaling as it's better to do it with Avisynth than to let the TV or the player do it with something crappy like a FastBilinear. As to your source, it seems to be starved which basically means that whoever encoded it did it at a very low bitrate thus removing important details.
With a source like this, upscaling is the LAST thing I would do.
If you really wanna re-encode it, just do deblocking with Deblock_QED() or the built-in deblocker of x264/x265 if you're planning to re-encode it in H.264/H.265 and a bit of denoise with dfttest(). It will look flat, but at least you won't have macroblocks and ringing everywhere.



By the way...

You linked a streaming website that I don't know, but I highly doubt that it's legal, so if it isn't, moderators will remove your link and you won't receive any further help as piracy is forbidden!

I just did a google search of the series and the first thing I found is a website with the DVDs of the series you linked. I strongly suggest you to get the official DVDs which are gonna be a relatively high bitrate MPEG-2 encodes at 720x480i which are far better than the crappy starved 240p source you linked.my question according to super resolution plug-in and this is a tv show there's official DVDs not available anywhere. that's why I'm asking btw I'm sorry for using increase quality basically I'm try to asking "how upscale pixels" that you answered [emoji3526]

StainlessS
24th December 2019, 20:36
On Amazon, Currently Unavailable:- https://www.amazon.in/Hatim-Star-Plus-serial-epsiodes/dp/B07RNCKZP5

Bad quality,plz fix it...

I was searching for it for last 5-6 years,but i didn't find any CD or DVD of it.
And at last i got it from amazon.
I was searching for it for better video quality like HD 720p but there is only in 244p which i already have in 360p.
Plz bring it in high resolution, then i will again buy it
Plz plz plz plz plz plz bring it in HD.
THANKS

Price is high

Here on SnapDeal (seems available, Rs 5000 rupees):- https://www.snapdeal.com/product/the-adventures-of-hatim-dvd/627087430366
Given prev quotes, might also be rubbish.

Google Search "Hatim DVD"
https://www.google.com/search?ei=QmYCXuLDHc_OgQb7wpzYAQ&q=Hatim+dvd&oq=Hatim+dvd&gs_l=psy-ab.3..0j0i22i30l8.10234.10771..10949...0.2..0.142.453.1j3......0....1..gws-wiz.......0i71j0i67.6Hgj7B3NDsA&ved=0ahUKEwji7O_mgc_mAhVPZ8AKHXshBxsQ4dUDCAo&uact=5

Good Luck.

EDIT: @ 1 Rupee = £0.011, I make it about £55.00 on Snapdeal, for a garbage DVD [assuming previous quotes also apply to SnapDeal DVD].
Suggest dont waste your money.

imsrk48
25th December 2019, 16:51
On Amazon, Currently Unavailable:- https://www.amazon.in/Hatim-Star-Plus-serial-epsiodes/dp/B07RNCKZP5







Here on SnapDeal (seems available, Rs 5000 rupees):- https://www.snapdeal.com/product/the-adventures-of-hatim-dvd/627087430366
Given prev quotes, might also be rubbish.

Google Search "Hatim DVD"
https://www.google.com/search?ei=QmYCXuLDHc_OgQb7wpzYAQ&q=Hatim+dvd&oq=Hatim+dvd&gs_l=psy-ab.3..0j0i22i30l8.10234.10771..10949...0.2..0.142.453.1j3......0....1..gws-wiz.......0i71j0i67.6Hgj7B3NDsA&ved=0ahUKEwji7O_mgc_mAhVPZ8AKHXshBxsQ4dUDCAo&uact=5

Good Luck.

EDIT: @ 1 Rupee = £0.011, I make it about £55.00 on Snapdeal, for a garbage DVD [assuming previous quotes also apply to SnapDeal DVD].
Suggest dont waste your money.[emoji16][emoji16][emoji16][emoji16]

StainlessS
26th December 2019, 02:57
Imsrk48,

Below is auto generated from a much bigger script.
Source has a weird ripple effect, I think may have been in XVID/DIVX at some point.
Also sections have duplicates where seems to be about 2/3 framerate of the source 24FPS, this messes with motion compensation stuff.
Could stand getting rid of the logos at bottom [see InPaintDelogo thread].
About as much time as I would be prepared to spend on it [although many have spent a long time trying to repair worse clips]


V=LSmashVideoSource(".\Hatim Episode 1 - Tunepk.mp4") # LSmash Plugin
A=LSmashAudioSource(".\Hatim Episode 1 - Tunepk.mp4")
AudioDub(V,A)
ORG=Last

# Below auto generated from Manual settings
Deblock(28) # Plugin (might want to adjust this value)

Cropped=Crop(0,0,0,0,align=true)

# AutoLevels from my MediaFire account, v0.12Beta3_20190711
Cropped.AutoLevels(
\ FilterRadius=12,
\ gamma=UnDefined,
\ AutoGamma=False,
\ midpoint=0.500000,
\ input_low=UnDefined,
\ input_high=UnDefined,
\ ignore_low=0.001953,
\ ignore_high=0.001953,
\ border_l=0,
\ border_r=0,
\ border_t=0,
\ border_b=0,
\ Debug=False,
\ sc2Th=8,
\ sc2Perc=33.333332,
\ gammax=1.500000,
\ gammin=0.666667,
\ MinRng=100)

McDegrainSharp(frames=2,csharp=0.333000,Precise=False) # http://forum.doom9.org/showthread.php?p=1737045#post1737045 [Might want to adjust frames (1->3)]
nnedi3_rpow2(rfactor=4,cshift="Spline36Resize",fwidth=960,fheight=720) # Plugin (960x720=4:3)

Limiter(16,235,16,240)

AudioDub(Last,MergeChannels(GetChannel(1),GetChannel(1))) # Make 2 channel
ResampleAudio(44100) # from 22.50 KHz

MeGUI_DarX=4 MeGUI_DarY=3 # Auto set Megui DAR : SnapDeal says DAR is 16:10, looks more like 4:3 to me.

Trim(0,0) # chop/pad audio to match video length
Return Last
Return StackHorizontal(ORG.Spline36Resize(960,720),Last) # Original on left, Doctored on right. # COMMENT OUT Above Return Last


Again, Good Luck.

EDITED as per later post.

imsrk48
26th December 2019, 04:03
Imsrk48,

Below is auto generated from a much bigger script.
Source has a weird ripple effect, I think may have been in XVID/DIVX at some point.
Also sections have duplicates where seems to be about 2/3 framerate of the source 24FPS, this messes with motion compensation stuff.
Could stand getting rid of the logos at bottom [see InPaintDelogo thread].
About as much time as I would be prepared to spend on it [although many have spent a long time trying to repair worse clips]


V=LSmashVideoSource(".\Hatim Episode 1 - Tunepk.mp4") # LSmash Plugin
A=LSmashAudioSource(".\Hatim Episode 1 - Tunepk.mp4")
AudioDub(V,A)


# Below auto generated from Manual settings
Deblock(28) # Plugin (might want to adjust this value)

Cropped=Crop(0,0,0,0,align=true)

# AutoLevels from my MediaFire account, v0.12Beta3_20190711
Cropped.AutoLevels(
\ FilterRadius=12,
\ gamma=UnDefined,
\ AutoGamma=False,
\ midpoint=0.500000,
\ input_low=UnDefined,
\ input_high=UnDefined,
\ ignore_low=0.001953,
\ ignore_high=0.001953,
\ border_l=0,
\ border_r=0,
\ border_t=0,
\ border_b=0,
\ Debug=False,
\ sc2Th=8,
\ sc2Perc=33.333332,
\ gammax=1.500000,
\ gammin=0.666667,
\ MinRng=100)

McDegrainSharp(frames=2,csharp=0.333000,Precise=False) # http://forum.doom9.org/showthread.php?p=1737045#post1737045 [Might want to adjust frames (1->3)]
nnedi3_rpow2(rfactor=4,cshift="Spline36Resize",fwidth=960,fheight=720) # Plugin (960x720=4:3)

Limiter(16,235,16,240)

AudioDub(Last,MergeChannels(GetChannel(1),GetChannel(1))) # Make 2 channel
ResampleAudio(44100) # from 22.50 KHz

MeGUI_DarX=4 MeGUI_DarY=3 # Auto set Megui DAR : SnapDeal says DAR is 16:10, looks more like 4:3 to me.

Trim(0,0) # chop/pad audio to match video length
Return Last


Again, Good Luck.Thanks a lot sir for your huge kind and hard work[emoji3531]

StainlessS
26th December 2019, 04:14
imsrk48,

There is not a huge difference, but there is some.
Can compare with simple Spline36Resize using below.

After AudioDub line add

ORG=Last


Replace Return last line with

Return StackHorizontal(ORG.Spline36Resize(960,720),Last) # Original on left, Doctored on right.


View in VirtualDub2
[EDIT: See my prev post, marked in Blue]
Could use above to adjust eg Deblock() arg whilst seeing before and after frames.

MysteryX did some supposed SuperRez thing [EDIT: in devs forum] , dont know if would produce any great improvement [never used it].

EDIT:
Also, in future, might be better to start your own thread [its quite easy], this thread is really about eg changes in avisynth itself [or questions about avisynth], rather than processing video.
People may be more reluctant to answer video processing questions when posted in the wrong thread.

EDIT: You might want to try with deblock() lowered or completely removed, see what it looks like (DeBlock can fix some types of blocking, but can also cause damage, its a balancing act).
Also, it may be that some of the blocking is from before 1 or more resizes to the source, if so then using deblock cannot help for that blocking, its burned in.
The Baby Face, near beginning does benefit from deblock , maybe use those frames to get best setting, try not to go too high, I think max is about 30 or 32.

csharp adjusts sharpness in McDegrainSharp [McDegrainSharp(frames=2,csharp=0.333000,Precise=False)], default is 0.6 but I tend to
use 0.3 or thereabouts for MY default, suggest dont go above 0.6.

EDIT: Another version to try. Switched on NonLinUSM in script generator, & slight mods to script generator defaults.

V=LSmashVideoSource(".\Hatim Episode 1 - Tunepk.mp4") # LSmash Plugin
A=LSmashAudioSource(".\Hatim Episode 1 - Tunepk.mp4")
AudioDub(V,A)
ORG=Last

# Below auto generated from Manual/Auto_detected, settings

Deblock(20) # Reduced from 24

Cropped=Crop(0,0,0,0,align=true) # QueryBorderCropped And/Or Remove Padding for prev DeBlock filter
Cropped.AutoLevels(
\ FilterRadius=12,
\ gamma=UnDefined,
\ AutoGamma=False,
\ midpoint=0.500000,
\ input_low=UnDefined,
\ input_high=UnDefined,
\ ignore_low=0.001000,
\ ignore_high=0.001000,
\ border_l=0,
\ border_r=0,
\ border_t=0,
\ border_b=0,
\ Debug=False,
\ sc2Th=8,
\ sc2Perc=33.333332,
\ gammax=1.100000,
\ gammin=0.909091,
\ MinRng=100)

McDegrainSharp(2,csharp=0.300000,Precise=False) # Pre-Upsize # have reduced (a little) to 0.3, sharpness csharp, 0.0 -> 0.6

nnedi3_rpow2(rfactor=4,cshift="Spline36Resize",fwidth=960,fheight=720) # Upsize

NonlinUSM(z=3, pow=1.100000, str=0.250000, rad=9) # ADDED: Search NonlinUSM script : Can Mod local contrast, suggest str 0.2 - 0.33

Limiter(16,235,16,240) # Limit to TV_Levels range

AudioDub(Last,MergeChannels(GetChannel(1),GetChannel(1))) # Matching to required output, 2 audio channels
ResampleAudio(44100) # Match to required Audio SampleRate

MeGUI_DarX=4 MeGUI_DarY=3

Trim(0,0) # chop/pad audio to match video length
#Return Last # End of Generated Script
Return StackHorizontal(ORG.Spline36Resize(960,720),Last)

NonlinUSM is a sort of local contrast, pixel luma contrast adjusted with respect to pixels near to it, will look somewhat like sharpening and probably be
most evident in eg hair. If I use it, I usually use 0.25 or 0.33. Can just comment out that line if you dont like it.

EDIT: From the clip, seems to be a Hindi, "Lord Of The Rings" clone.
EDIT: Added some comments in script generator, marked above in RED

imsrk48
27th December 2019, 05:33
Okay Sir,

Please someone suggest me all Softwares that working with Avisynth.

I'm trying to learn Avisynth.

StainlessS
27th December 2019, 06:15
See Wiki [see everything on wiki homepage] :- http://avisynth.nl/index.php/Main_Page

Internal filters:- http://avisynth.nl/index.php/Internal_filters
External Filters:- http://avisynth.nl/index.php/External_filters

imsrk48
27th December 2019, 06:26
See Wiki [see everything on wiki homepage] :- http://avisynth.nl/index.php/Main_Page

Internal filters:- http://avisynth.nl/index.php/Internal_filters
External Filters:- http://avisynth.nl/index.php/External_filtersThanks Sir

Mertiz88
31st March 2020, 11:01
Hi there,
Iv'e searched many times but couldn't find what I'm looking for. My question is, can I use any filter of Avisynth separately. For example, someone gave me an encoded video and I wanna apply some filter on it without encoding it again? is that possible by command line or any other way?
Thanks.

stax76
31st March 2020, 11:29
Hi there,
Iv'e searched many times but couldn't find what I'm looking for. My question is, can I use any filter of Avisynth separately. For example, someone gave me an encoded video and I wanna apply some filter on it without encoding it again? is that possible by command line or any other way?
Thanks.

mpv allows ffmpeg and vapoursynth filters:


ffmpeg filters:

https://mpv.io/manual/master/#video-filters


vapoursynth filters:

https://mpv.io/manual/master/#video-filters-vapoursynth


per file configuration:

https://mpv.io/manual/master/#file-specific-configuration-files

hello_hello
31st March 2020, 11:38
Mertiz88,

If you have ffdshow installed it has an Avisynth filter and you can add most things to it. "Add ffdshow video source" usually needs to be checked near the top of the Avisynth filter section.

You can probably install only the ffdshow raw video filter and add it to MPC-HC as an external filter and add Avisynth stuff to it.

I don't use Potplayer, but it has an Avisynth section in it's options so it should do much the same.

Or you could create a script to open the video and audio, add filters to it, then open the script with a media player such as MPC-HC. ie

LoadPlugin("C:\Program Files\MeGUI\tools\ffms\ffms2.dll")
FFMS2("E:\Episode 7.mkv")
SomeFilter()

You'll probably have to be careful not to use any filtering that's too slow to allow real-time playback.

StainlessS
31st March 2020, 12:14
There is also a new-ish video source for VLC [ VLC - AviSynth plugin ]:- https://forum.doom9.org/showthread.php?t=178531

Mertiz88
31st March 2020, 17:05
Thanks guys for great information, much appreciated!!
I'm still newbie for these stuff (like using or adding filters of (avisynth/vapoursynth) to other softwares). I just used handbrake to encode some videos and found out they need to be denoised (slightly) but couldn't do that with its filters (NLMeans & HQDN3D). So, I intended to filter them with staxrip at first and then thought about doing that separately by (avisynth/vapoursynth). What I meant, I want a new video to be created (like 'render' in some video editors) but with exactly the same encode settings (CRF, subme, ref, ....etc) i.e. only the filter will be applied. Is that even possible with the methods you mentioned above OR the filter's effect will remain only in the media player (VLC/mpv/MPC). If you can explain with some details, I'll be thankful!

Selur
2nd April 2020, 04:54
Filtering interlaced content:
Reading: http://avisynth.nl/index.php/FAQ_different_types_content#How_do_I_process_interlaced_content.3F
I'm wondering whether:
AssumeXY().Bob().Filter(...).AssumeXY().Separatefields().Selectevery(4,0,3).Weave()
would be better than:
SeparateFields()
even = SelectEven(last).Filter(...)
odd = SelectOdd(last).Filter(...)
Interleave(even, odd)
Weave()
thinking about temporal filters I thought the second one would be better suited,...

What do you think is 'better' and why? Is it depended on the following filter or is one always better than the other.
Note: that I don't care that the first method adds an additional bobber and the time it takes,...

Cu Selur

poisondeathray
2nd April 2020, 07:03
Filtering interlaced content:
Reading: http://avisynth.nl/index.php/FAQ_different_types_content#How_do_I_process_interlaced_content.3F
I'm wondering whether:
AssumeXY().Bob().Filter(...).AssumeXY().Separatefields().Selectevery(4,0,3).Weave()
would be better than:
SeparateFields()
even = SelectEven(last).Filter(...)
odd = SelectOdd(last).Filter(...)
Interleave(even, odd)
Weave()
thinking about temporal filters I thought the second one would be better suited,...

What do you think is 'better' and why? Is it depended on the following filter or is one always better than the other.
Note: that I don't care that the first method adds an additional bobber and the time it takes,...

Cu Selur





It depends on source, and what you are doing, obviously

Not bob() for the first case - use a smarter double rate deinterlacer that corrects for the up/down field shift.

It's pros /cons -

In the 1st case you have to deinterlace, but you can use temporal filter more effectively

In the 2nd case, you don't get temporal filtering between even/odd fields, only within each group. Motion vectors don't cross between even/odd because they are grouped separately. This can induce a type of flicker on some sources.

But on the other hand some sources may require separate filtering (eg. some defect occurs on even fields, maybe more noise or more saturated etc...) . Using the 1st method will "contaminate" the good fields in those cases

Selur
2nd April 2020, 14:02
Not bob() for the first case - use a smarter double rate deinterlacer that corrects for the up/down field shift.
Just wrote bob not having to start a discussion which bobber might be better suited in this case. :)

It's pros /cons -
In the 1st case you have to deinterlace, but you can use temporal filter more effectively
In the 2nd case, you don't get temporal filtering between even/odd fields, only within each group. Motion vectors don't cross between even/odd because they are grouped separately. This can induce a type of flicker on some sources.
But on the other hand some sources may require separate filtering (eg. some defect occurs on even fields, maybe more noise or more saturated etc...) . Using the 1st method will "contaminate" the good fields in those cases
Thanks for the clarification. :)

Sharc
2nd April 2020, 16:43
And how is it for spatial filtering?
In the 'bob' case the spatial filtering is basically done for the original field and the synthesized other field.
In the 'even/odd' case the spatial filtering is done intra-field (the original fields) only.
Is this correct? Is one method better than the other, or does it also depend on the source?
Some noise filters are spatial-temporal; is there a clear preference for these, or is it also source dependent (I tend to believe so).

FranceBB
7th July 2020, 23:51
Question about the wiki.
In the VapourSource (http://avisynth.nl/index.php/VapourSource) page it says: "*Y8/YV12/16/24 allow bit depths >8 using the Stack16 format." however when I look at the color spaces themselves like YUV420P16 it says "YV12 (x2 width)".
I haven't tried to output anything through VapourSource 'cause I don't have VapourSynth installed, but to me "x2 width" means DoubleWidth which is 16bit interleaved NOT 16bit stacked (which is double height).
Is it outputting 16bit stacked or interleaved? Is it 2x height so 16bit stacked or 2x width so 16bit interleaved?
I'm asking 'cause I generally correct the wiki when I find boo boos and I like everything to be right. :)


p.s yes, wiki maintainers, if you found out some pages (like this (http://avisynth.nl/index.php/ConvertStacked#Notes)) silently and "auto-magically" updating themselves, it wasn't dark magic, it was me xD

feisty2
8th July 2020, 14:35
you won't be needing the stack16 format, my filters/scripts are exclusive to fp32 precision and you will be dealing with YUV444PS or YV24 x4 height (what is this?).

real.finder
8th July 2020, 15:59
Question about the wiki.
In the VapourSource (http://avisynth.nl/index.php/VapourSource) page it says: "*Y8/YV12/16/24 allow bit depths >8 using the Stack16 format." however when I look at the color spaces themselves like YUV420P16 it says "YV12 (x2 width)".
I haven't tried to output anything through VapourSource 'cause I don't have VapourSynth installed, but to me "x2 width" means DoubleWidth which is 16bit interleaved NOT 16bit stacked (which is double height).
Is it outputting 16bit stacked or interleaved? Is it 2x height so 16bit stacked or 2x width so 16bit interleaved?
I'm asking 'cause I generally correct the wiki when I find boo boos and I like everything to be right. :)


p.s yes, wiki maintainers, if you found out some pages (like this (http://avisynth.nl/index.php/ConvertStacked#Notes)) silently and "auto-magically" updating themselves, it wasn't dark magic, it was me xD

I think it's like the old LSMASHSource, it will out in interleaved unless you set stacked=true

but in avs+ it will output HBD

I think you should re-stated that lsb in most filters mean stacked in http://avisynth.nl/index.php/ConvertStacked since there are many n00bs users

FranceBB
9th July 2020, 09:03
I think it's like the old LSMASHSource, it will out in interleaved unless you set stacked=true

but in avs+ it will output HBD


Ok, got it. Corrected on the wiki ;)


I think you should re-stated that lsb in most filters mean stacked in http://avisynth.nl/index.php/ConvertStacked since there are many n00bs users

Done. ;)