There's another thread somewhere here where I posted links for the relevant avs filters. Then just make a filename.avs with whatever scripting things. Here's a sample avs, to help you understand avs scripting:
LoadPlugin("E:\applications\video\YV12-filters\vsfilter.dll")
LoadPlugin("E:\applications\video\YV12-filters\dup.dll")
LoadPlugin("E:\applications\video\YV12-filters\undot.dll")
LoadPlugin("E:\applications\video\YV12-filters\_2DCleanYUY2_for_25.dll")
avisource("GUNSLINGER GIRL 第09話 「彼岸花 - Lycoris radiata Herb -」.avi").killaudio()
UnDot()
_2DCleanYUY2(thresholdY=3, radiusX=1, radiusY=1)
Dup(threshold=.4,show=false,maxcopies=20,copy=true ,blend=true,chroma=true)
textsub("09\gsg09ep.ssa")
textsub("09\gsg09op.ssa")
textsub("09\gsg09ed.ssa")
textsub("09\gsg09cr.ssa")
I also posted in that other thread how to use xvid1b.