Code: Select all
"But wait!" you cry. "What of your dreaded bumper and it's impending doom?" Ah yes I'd almost forgotten the bumper! Well, since I'm trying to show all the superneato stuff you can do with AVISynth, I think I'll write a function to remove the bumper. Yep - you can actually write functions within AVISynth. No, this isn't just for show, it can actually be very useful.
So I'll write a function that returns a clip after Trimming the first 484 frames off of it (since that's how long my bumper is in 29.97fps). I'll shorten TrimBumper to TB for ease of typing later:
function TB(clip input)
{
return input.Trim(484,0)
}
Now that I've written this function, I can apply it to each of the video sources and splice them all together, then output the result:
return a.TB() + b.TB() + c.TB() + d.TB()
and tada! My script is done. For a complete rundown, here is the final script in its entirity:
function TB(clip input)
{
return input.Trim(484,0)
}
a = AVISource("D:\ErMaC Studios - Closer to God 2.avi")
b = AVISource("D:\ErMaC Studios - Cowboy Blues.avi")
c = AVISource("D:\ErMaC Studios - Go Speed Go.avi")
d = AVISource("D:\ErMaC Studios - Evil Light.avi")
b = b.BicubicResize(512,384)
c = c.BicubicResize(512,384)
a = a.AddBorders(0,56,0,56)
d = d.AddBorders(0,56,0,56)
b = b.ChangeFPS(29.97)
d = d.ChangeFPS(29.97)
return a.TB() + b.TB() + c.TB() + d.TB()
Note that I moved the function up to the top since that's the best place for defining functions, but it could go anywhere in the script as long as it's before the first time TB() is used.
If you'd like to see the nastiest AVISynth script I've ever written, here it is. It was a script which I fed into an MPEG2 encoder to make my own Read or Die subtitled, progressive DVD. It looks fantastic, BTW :D
function Sub(clip clip, string filename)
{
LoadVirtualdubPlugin("C:\program files\virtualdub\plugins\subtitler.vdf", "_VD_Subtitler")
return clip._VD_Subtitler(1, filename, 0, 0)
}
LoadPlugin("D:\MPEG2DEC.DLL")
LoadPlugin("D:\Decomb.DLL")
rod1 = MPEG2Source("E:\ReadOrDie1DVD\rod1.d2v").Telecide(chroma=true,post=false,threshold=35).Decimate(cycle=5).ConvertToRGB().Sub("E:\ReadOrDie1DVD\Read Or Die Ep 01 [FINAL 230601].ssa")
rod2 = MPEG2Source("E:\rod2.d2v").Telecide(chroma=true,post=false,threshold=35).Decimate(cycle=5).ConvertToRGB().Sub("E:\ReadOrDie2DVD\RoD2.v5.Edit.silencer.ssa")
rod3 = MPEG2Source("E:\ReadOrDie3DVD\rod3.d2v").Telecide(chroma=true,post=false,threshold=35).Decimate(cycle=5).ConvertToRGB().Sub("E:\ReadOrDie3DVD\ROD3-Edit4.ssa")
return rod1 + BlankClip(length=3,height=480,width=720,fps=23.976,audio_rate=0) + rod2 + rod3
thanks -- Point me in the right direction and I'll gladly do some more reading.