Advanced Editing Script

This script was created to help me edit anime music videos directly in AviSynth by helping to reduce the amount of scripting. This script is intended for advanced users and is not recommended for beginners.

Advanced Editing Script

File Name: AdvancedEdit_v1.1.2.avsi

###################################################################################################################################
#
#  Advanced Edit by l33tmeatwad
#  v1.1.2 - 5-9-2016
#
#  AdvCrop
#     Syntax:  AdvCrop(clip, [Crop Values], [Crop Direction], [Modulus], [Shift Direction], [Shift Amount])
#
#     Parameters:
#       Crop                   (Default = "0,0")
#          -Use to specify the amount to crop from the top & bottom or right & left sides.
#       Direction              (Default = "vertical")
#          -Use to specify if cropping the top & bottom or right & left sides.
#       CropMod                (Default = 2)
#          -Use to specify the modulus, but it is ignored if the clip is RGB.
#       Shift                  (Default = "top")
#          -Use to specify a side to reduce cropping on and increase the other.
#       ShiftAmount            (Default = 2)
#          -Use to specify the amount to shift.
#
#  AdvFrames
#     Syntax:  AdvFrames(clip, [repeat frame count], [frame #1], [frame #2],...[frame #25])
#          -Max number of frames is 25
#
#  AdvResize
#     Syntax:  AdvResize(clip, [New Size], [Resize by Width or Height], [Aspect Ratio], [Resize Method], [Modulus])
#
#     Parameters:
#       Size                   (Default = <clip width or height>)
#          -Use to specify the size of the width or height.
#       ResizeBy               (Default = "height")
#          -Use to specify if size represents width or height.
#       AspectRatio            (Default = <clip aspect ratio>)
#          -Use to specify the desired aspect ratio.
#       ResizeMethod           (Default = "spline36resize")
#          -Use to specify the resize method.
#       ResizeMod              (Default = 2)
#          -Use to specify the resize modulus, but it is ignored if the clip is RGB.
#
#  AdvTrim
#     Syntax:  AdvTrim(clip, [first frame clip#1], [last frame clip#1], [reverse clip? true/false],....)
#     (NOTE: clip#a/b & rev# variables don't need to be named if entered chronologically, other variables can be placed inbetween.)
#
#     Parameters:
#       (NOTE: Replace # with the clip number for variables listed below, the highest clip number is 10.) 
#       Clip#a                 (Default = -1)
#          -Use to specify the clip starting frame.
#       Clip#b                 (Default = -1)
#          -Use to specify the clip ending frame.
#       Rev#                   (Default = false)
#          -Use to reverse a clip.
#       FPS#                   (Default = false)
#          -Use to alter the speed of a clip by changing the framerate.
#          (NOTE: Lower framerates speed up the clip, higher rates make it slower.)
#       FadeA                  (Default = 0)
#          -Crossfade between all clips.
#       Fade#                  (Default = 0)
#          -Crossfade after specified clip to the next one, options are 1-9.
#       ExF#                   (Default = "None")
#          -Specify extra filters to run on the specified clip, use single line syntax and place them in quotation marks together.
#
#  AdvTrim
#     Syntax:  AdvTrim(clip, [first frame clip#1], [last frame clip#1], [reverse clip? true/false],....)
#     (NOTE: clip#a/b & rev# variables don't need to be named if entered chronologically, other variables can be placed inbetween.)
#
#     Parameters:
#       (NOTE: Replace # with the clip number for variables listed below, the highest clip number is 10.) 
#       Clip#a                 (Default = -1)
#          -Use to specify the clip starting frame.
#       Clip#b                 (Default = -1)
#          -Use to specify the clip ending frame.
#       Rev#                   (Default = false)
#          -Use to reverse a clip.
#       FPS#                   (Default = false)
#          -Use to alter the speed of a clip by changing the framerate.
#          (NOTE: Lower framerates speed up the clip, higher rates make it slower.)
#       FadeA                  (Default = 0)
#          -Crossfade between all clips.
#       Fade#                  (Default = 0)
#          -Crossfade after specified clip to the next one, options are 1-9.
#       ExF#                   (Default = "None")
#          -Specify extra filters to run on the specified clip, use single line syntax and place them in quotation marks together.
#
#  Timecode
#     Syntax:  Timecode([Timecode], [Frames Per Second])
#
#     Parameters:
#       Timecode               (Default = "00:00:00.000")
#          -Use to specify a timecode to conver to a frame number.
#       FPS                    (Default = 23.976)
#          -Use to specify the frame rate used to calculate the frame number from the timecode. 
#
#  TimecodeTrim
#     Syntax:  TimecodeTrim(clip, [StartTime], [EndTime])
#
#     Parameters:
#       StartTime              (Default = "00:00:00.000")
#          -Use to specify the clip starting time.
#       StartEnd               (Default = "00:00:00.000")
#          -Use to specify the clip ending time.
#
#
###################################################################################################################################

function AdvCrop(clip clip, string "Crop", string "Direction", int "CropMod",string "Shift", int "ShiftAmount") {

ColorSpace = (IsRGB24(clip) == true || IsRGB32(clip) == true) ? true : false

Crop = Default(Crop, "0,0")
Direction = Default(Direction, "vertical")
CropMod = Default(CropMod, 2)
Shift = Default(Shift, "top")
ShiftAmount = Default(ShiftAmount, 0)

AspectRatio = (Direction == "horizontal") ? Float(Height(clip))/Width(clip) : Float(Width(clip))/Height(clip)

Side1 = Round(Value(LeftStr(Crop, FindStr(Crop, ",")-1)))
Side1Mod = Side1%CropMod
Side1 = (ColorSpace == true) ? Side1 : (Side1Mod > CropMod/2) ? Side1+(CropMod-Side1Mod)  : Side1-Side1Mod

Side2 = Round(Value(RightStr(Crop, StrLen(Crop)-FindStr(Crop, ","))))
Side2Mod = Side2%CropMod
Side2 = (ColorSpace == true) ? Side2 : (Side2Mod > CropMod/2) ? Side2+(CropMod-Side2Mod)  : Side2-Side2Mod

Size = (Direction == "horizontal") ? (Height(clip)-((Width(clip)-(Side1+Side2))*AspectRatio)) : (Width(clip)-((Height(clip)-(Side1+Side2))*AspectRatio))

Side3 = Floor(Size/2)
Side3Mod = Side3%CropMod
Side3 = (ColorSpace == true) ? Side3 : (Side3Mod > CropMod/2) ? Side3+(CropMod-Side3Mod)  : Side3-Side3Mod

Side4 = Ceil(Size/2)
Side4Mod = Side4%CropMod
Side4 = (ColorSpace == true) ? Side4 : (Side4Mod > CropMod/2) ? Side4+(CropMod-Side4Mod)  : Side4-Side4Mod

ShiftMod = ShiftAmount%CropMod
ShiftAmount = (ColorSpace == true) ? ShiftAmount : (ShiftMod > CropMod/2) ? ShiftAmount+(CropMod-ShiftMod)  : ShiftAmount-ShiftMod
ShiftAmount = (Shift == "left" || Shift == "top" && Side3 >= ShiftAmount) ? Side3 : Side3
ShiftAmount = (Shift == "right" || Shift == "bottom" && Side4 >= ShiftAmount) ? Side4 : Side4
#ShiftAmount = (Side3 >= ShiftAmount) ? Side3 : ShiftAmount

Side3 = (Shift == "left" || Shift == "top" ) ? Side3-ShiftAmount : Side3+ShiftAmount
Side4 = (Shift == "left" || Shift == "top" ) ? Side4+ShiftAmount : Side4-ShiftAmount

Top= (Direction == "horizontal") ? Side3 : Side1
Bottom= (Direction == "horizontal") ? Side4 : Side2
Left= (Direction == "horizontal") ? Side1 : Side3
Right= (Direction == "horizontal") ? Side2 : Side4


return Eval("clip.crop(" + String(Left) + "," + String(Top) + ",-" + String(Right) + ",-" + String(Bottom) + ")").Subtitle(String(Side4),align=6)
}

function AdvFrames(clip, int "a", int "b", int "c", int "d", int "e", int "f", int "g", int "h", int "i", int "j", int "k", int "l", int "m", int "n", int "o", int "p", int "q", int "r", int "s", int "t", int "u", int "v", int "w", int "x", int "y", int "z") {

a = Default(a, 1)
b = Default(b, 0)
c = Default(c, -1)
d = Default(d, -1)
e = Default(e, -1)
f = Default(f, -1)
g = Default(g, -1)
h = Default(h, -1)
i = Default(i, -1)
j = Default(j, -1)
k = Default(k, -1)
l = Default(l, -1)
m = Default(m, -1)
n = Default(n, -1)
o = Default(o, -1)
p = Default(p, -1)
q = Default(q, -1)
r = Default(r, -1)
s = Default(s, -1)
t = Default(t, -1)
u = Default(u, -1)
v = Default(v, -1)
w = Default(w, -1)
x = Default(x, -1)
y = Default(y, -1)
z = Default(z, -1)


nclip = clip.trim(b,b).loop(a)
nclip = (c>=0) ? nclip+clip.trim(c,c).loop(a) : nclip
nclip = (d>=0) ? nclip+clip.trim(d,d).loop(a) : nclip
nclip = (e>=0) ? nclip+clip.trim(e,e).loop(a) : nclip
nclip = (f>=0) ? nclip+clip.trim(f,f).loop(a) : nclip
nclip = (g>=0) ? nclip+clip.trim(g,g).loop(a) : nclip
nclip = (h>=0) ? nclip+clip.trim(h,h).loop(a) : nclip
nclip = (i>=0) ? nclip+clip.trim(i,i).loop(a) : nclip
nclip = (j>=0) ? nclip+clip.trim(j,j).loop(a) : nclip
nclip = (k>=0) ? nclip+clip.trim(k,k).loop(a) : nclip
nclip = (l>=0) ? nclip+clip.trim(l,l).loop(a) : nclip
nclip = (m>=0) ? nclip+clip.trim(m,m).loop(a) : nclip
nclip = (n>=0) ? nclip+clip.trim(n,n).loop(a) : nclip
nclip = (o>=0) ? nclip+clip.trim(o,o).loop(a) : nclip
nclip = (p>=0) ? nclip+clip.trim(p,p).loop(a) : nclip
nclip = (q>=0) ? nclip+clip.trim(q,q).loop(a) : nclip
nclip = (r>=0) ? nclip+clip.trim(r,r).loop(a) : nclip
nclip = (s>=0) ? nclip+clip.trim(s,s).loop(a) : nclip
nclip = (t>=0) ? nclip+clip.trim(t,t).loop(a) : nclip
nclip = (u>=0) ? nclip+clip.trim(u,u).loop(a) : nclip
nclip = (v>=0) ? nclip+clip.trim(v,v).loop(a) : nclip
nclip = (w>=0) ? nclip+clip.trim(w,w).loop(a) : nclip
nclip = (x>=0) ? nclip+clip.trim(x,x).loop(a) : nclip
nclip = (y>=0) ? nclip+clip.trim(y,y).loop(a) : nclip
nclip = (z>=0) ? nclip+clip.trim(z,z).loop(a) : nclip

return nclip
}

function AdvResize(clip clip, int "Size", string "ResizeBy", string "AspectRatio", string "ResizeMethod", int "ResizeMod") {

ColorSpace = (IsRGB24(clip) == true || IsRGB32(clip) == true) ? true : false
ResizeBy = Default(ResizeBy, "height")
Size = (ResizeBy == "width") ? Default(Size, width(clip)) : Default(Size, height(clip))
AspectRatio = Default(AspectRatio, String(width(clip))+":"+String(height(clip)))
ResizeMethod = Default(ResizeMethod, "spline36resize")
ResizeMod = (ColorSpace == true) ? Default(ResizeMod, 1) : Default(ResizeMod, 2)

ARwidth = Value(LeftStr(AspectRatio,FindStr(AspectRatio,":")-1))
ARheight = Value(RightStr(AspectRatio,StrLen(AspectRatio)-FindStr(AspectRatio,":")))
AspectRatio = (ResizeBy == "width") ? ARheight/ARwidth : ARwidth/ARheight

Width = (ResizeBy == "width") ? Size : Round(AspectRatio*Size)
Height = (ResizeBy == "height") ? Size : Round(AspectRatio*Size)

widthtest = width

WidthMod = Width%ResizeMod
HeightMod = Height%ResizeMod

Width = (WidthMod > ResizeMod/2) ? Width+(ResizeMod-WidthMod)  : Width-WidthMod
Height = (HeightMod > ResizeMod/2) ? Height+(ResizeMod-HeightMod) : Height-HeightMod

return Eval("clip." + ResizeMethod + "(" + String(Width) + "," + String(Height) + ")")
}

function AdvTrim(clip clip  , int "clip1a", int "clip1b", bool "rev1", int "clip2a", int "clip2b", bool "rev2", int "clip3a", int "clip3b", bool "rev3", int "clip4a", int "clip4b", bool "rev4", int "clip5a", int "clip5b", bool "rev5", int "clip6a", int "clip6b", bool "rev6", int "clip7a", int "clip7b", bool "rev7", int "clip8a", int "clip8b", bool "rev8", int "clip9a", int "clip9b", bool "rev9", int "clip10a", int "clip10b", bool "rev10", val "fps1", val "fps2", val "fps3", val "fps4", val "fps5", val "fps6", val "fps7", val "fps8", val "fps9", val "fps10", int "fadea", int "fade1", int "fade2", int "fade3", int "fade4", int "fade5", int "fade6", int "fade7", int "fade8", int "fade9", string "exf1", string "exf2", string "exf3", string "exf4", string "exf5", string "exf6", string "exf7", string "exf8", string "exf9", string "exf10") {

fps = framerate(clip)
clip1a = Default(clip1a, 0)
clip1b = Default(clip1b, 0)
clip2a = Default(clip2a, -1)
clip2b = Default(clip2b, -1)
clip3a = Default(clip3a, -1)
clip3b = Default(clip3b, -1)
clip4a = Default(clip4a, -1)
clip4b = Default(clip4b, -1)
clip5a = Default(clip5a, -1)
clip5b = Default(clip5b, -1)
clip6a = Default(clip6a, -1)
clip6b = Default(clip6b, -1)
clip7a = Default(clip7a, -1)
clip7b = Default(clip7b, -1)
clip8a = Default(clip8a, -1)
clip8b = Default(clip8b, -1)
clip9a = Default(clip9a, -1)
clip9b = Default(clip9b, -1)
clip10a = Default(clip10a, -1)
clip10b = Default(clip10b, -1)

rev1 = Default(rev1, false)
rev2 = Default(rev2, false)
rev3 = Default(rev3, false)
rev4 = Default(rev4, false)
rev5 = Default(rev5, false)
rev6 = Default(rev6, false)
rev7 = Default(rev7, false)
rev8 = Default(rev8, false)
rev9 = Default(rev9, false)
rev10 = Default(rev10, false)

fps1 = Default(fps1, fps)
fps2 = Default(fps2, fps)
fps3 = Default(fps3, fps)
fps4 = Default(fps4, fps)
fps5 = Default(fps5, fps)
fps6 = Default(fps6, fps)
fps7 = Default(fps7, fps)
fps8 = Default(fps8, fps)
fps9 = Default(fps9, fps)
fps10 = Default(fps10, fps)

fadea = Default(fadea, 0)
fade1 = (fadea>0) ? Default(fade1, fadea) : Default(fade1, 0)
fade2 = (fadea>0) ? Default(fade2, fadea) : Default(fade2, 0)
fade3 = (fadea>0) ? Default(fade3, fadea) : Default(fade3, 0)
fade4 = (fadea>0) ? Default(fade4, fadea) : Default(fade4, 0)
fade5 = (fadea>0) ? Default(fade5, fadea) : Default(fade5, 0)
fade6 = (fadea>0) ? Default(fade6, fadea) : Default(fade6, 0)
fade7 = (fadea>0) ? Default(fade7, fadea) : Default(fade7, 0)
fade8 = (fadea>0) ? Default(fade8, fadea) : Default(fade8, 0)
fade9 = (fadea>0) ? Default(fade9, fadea) : Default(fade9, 0)

exf1 = Default(exf1, "None")
exf2 = Default(exf2, "None")
exf3 = Default(exf3, "None")
exf4 = Default(exf4, "None")
exf5 = Default(exf5, "None")
exf6 = Default(exf6, "None")
exf7 = Default(exf7, "None")
exf8 = Default(exf8, "None")
exf9 = Default(exf9, "None")
exf10 = Default(exf10, "None")

clip1 = rev1==true ? clip.trim(clip1a,clip1b).reverse() : clip.trim(clip1a,clip1b)
clip2 = (clip2a>=0 && rev2==true) ? clip.trim(clip2a,clip2b).reverse() : clip2a>=0 ? clip.trim(clip2a,clip2b) : NOP()
clip3 = (clip3a>=0 && rev3==true) ? clip.trim(clip3a,clip3b).reverse() : clip3a>=0 ? clip.trim(clip3a,clip3b) : NOP()
clip4 = (clip4a>=0 && rev4==true) ? clip.trim(clip4a,clip4b).reverse() : clip4a>=0 ? clip.trim(clip4a,clip4b) : NOP()
clip5 = (clip5a>=0 && rev5==true) ? clip.trim(clip5a,clip5b).reverse() : clip5a>=0 ? clip.trim(clip5a,clip5b) : NOP()
clip6 = (clip6a>=0 && rev6==true) ? clip.trim(clip6a,clip6b).reverse() : clip6a>=0 ? clip.trim(clip6a,clip6b) : NOP()
clip7 = (clip7a>=0 && rev7==true) ? clip.trim(clip7a,clip7b).reverse() : clip7a>=0 ? clip.trim(clip7a,clip7b) : NOP()
clip8 = (clip8a>=0 && rev8==true) ? clip.trim(clip8a,clip8b).reverse() : clip8a>=0 ? clip.trim(clip8a,clip8b) : NOP()
clip9 = (clip9a>=0 && rev9==true) ? clip.trim(clip9a,clip9b).reverse() : clip9a>=0 ? clip.trim(clip9a,clip9b) : NOP()
clip10 = (clip10a>=0 && rev10==true) ? clip.trim(clip10a,clip10b).reverse() : clip10a>=0 ? clip.trim(clip10a,clip10b) : NOP()

clip1 = (fps1!=fps) ? clip1.changefps(fps1).assumefps(fps) : clip1
clip2 = (clip2a>=0 && fps2!=fps) ? clip2.changefps(fps2).assumefps(fps) : clip2
clip3 = (clip3a>=0 && fps3!=fps) ? clip3.changefps(fps3).assumefps(fps) : clip3
clip4 = (clip4a>=0 && fps4!=fps) ? clip4.changefps(fps4).assumefps(fps) : clip4
clip5 = (clip5a>=0 && fps5!=fps) ? clip5.changefps(fps5).assumefps(fps) : clip5
clip6 = (clip6a>=0 && fps6!=fps) ? clip6.changefps(fps6).assumefps(fps) : clip6
clip7 = (clip7a>=0 && fps7!=fps) ? clip7.changefps(fps7).assumefps(fps) : clip7
clip8 = (clip8a>=0 && fps8!=fps) ? clip8.changefps(fps8).assumefps(fps) : clip8
clip9 = (clip9a>=0 && fps9!=fps) ? clip9.changefps(fps9).assumefps(fps) : clip9
clip10 = (clip10a>=0 && fps10!=fps) ? clip10.changefps(fps10).assumefps(fps) : clip10

clip1 = (exf1!="None") ? Eval( "clip1" + exf1 ) : clip1
clip2 = (exf2!="None") ? Eval( "clip2" + exf2 ) : clip2
clip3 = (exf3!="None") ? Eval( "clip3" + exf3 ) : clip3
clip4 = (exf4!="None") ? Eval( "clip4" + exf4 ) : clip4
clip5 = (exf5!="None") ? Eval( "clip5" + exf5 ) : clip5
clip6 = (exf6!="None") ? Eval( "clip6" + exf6 ) : clip6
clip7 = (exf7!="None") ? Eval( "clip7" + exf7 ) : clip7
clip8 = (exf8!="None") ? Eval( "clip8" + exf8 ) : clip8
clip9 = (exf9!="None") ? Eval( "clip9" + exf9 ) : clip9
clip10 = (exf10!="None") ? Eval( "clip10" + exf10 ) : clip10

nclip = clip1
nclip = (clip2a>=0 && fade1>0) ? dissolve(nclip,clip2,fade1) : (clip2a>=0) ? nclip+clip2 : nclip
nclip = (clip3a>=0 && fade2>0) ? dissolve(nclip,clip3,fade2) : (clip3a>=0) ? nclip+clip3 : nclip
nclip = (clip4a>=0 && fade3>0) ? dissolve(nclip,clip4,fade3) : (clip4a>=0) ? nclip+clip4 : nclip
nclip = (clip5a>=0 && fade4>0) ? dissolve(nclip,clip5,fade4) : (clip5a>=0) ? nclip+clip5 : nclip
nclip = (clip6a>=0 && fade5>0) ? dissolve(nclip,clip6,fade5) : (clip6a>=0) ? nclip+clip6 : nclip
nclip = (clip7a>=0 && fade6>0) ? dissolve(nclip,clip7,fade6) : (clip7a>=0) ? nclip+clip7 : nclip
nclip = (clip8a>=0 && fade7>0) ? dissolve(nclip,clip8,fade7) : (clip8a>=0) ? nclip+clip8 : nclip
nclip = (clip9a>=0 && fade8>0) ? dissolve(nclip,clip9,fade8) : (clip9a>=0) ? nclip+clip9 : nclip
nclip = (clip10a>=0 && fade9>0) ? dissolve(nclip,clip10,fade9) : (clip10a>=0) ? nclip+clip10 : nclip

return nclip
}

function Timecode(string "timecode", float "fps") {

Timecode = Default(Timecode, "00:00:00.000")
FPS = Default(FPS, 23.976)

  Timecode = (FindStr(Timecode,".") > 9 ) ? MidStr(Timecode, (FindStr(Timecode,".")-8), StrLen(Timecode)) : Timecode
  Length = FindStr(Timecode,".")
  DecLength = FindStr(Timecode,".")+3-StrLen(Timecode)
  Adjust = "00:00:00.000"
  Timecode = (LeftStr(Adjust, 9-Length))+timecode+(RightStr(Adjust, 10+DecLength))

  Timecode=((Value(MidStr(Timecode,1,2))*60.0)*60.0)+(Value(MidStr(Timecode,4,2))*60.0)+Value(MidStr(Timecode,7,2))+(Value(MidStr(Timecode,10,3))/1000.0)
  return Round(Timecode*fps)
}

function TimecodeTrim(clip clip, string "StartTime", string "EndTime") {

StartTime = Default(StartTime, "00:00:00.000")
EndTime = Default(EndTime, "00:00:00.000")

StartTime = TimeCode(StartTime, FrameRate(clip))
EndTime = TimeCode(EndTime, FrameRate(clip))

return clip.trim(StartTime,EndTime)
}


Release Notes

Version 1.1.2 (5-9-2016)

  • Fixed issue where RGB always ignored ResizeMod setting.

Version 1.1.1 (3-14-2016)

  • Fixed default value for EndTime in TimecodeTrim.

Version 1.1 (3-11-2016)

  • Added AdvCrop, AdvResize, Timecode, and TimecodeTrim.

Version 1.0.1 (7-3-2014)

  • Fixed error with variables for the AdvTrim Fade parameter.

Version 1.0 (10-16-2013)

  • Created based on l33t Script.

Example of Use

###########################################################################################
#
#  MUSIC VIDEO TANGLED IN THE MOMENT by L33TMEATWAD
#    Total Length = 5500
#    Video Media Source = Tangled Blu-ray & 3D Blu-ray
#    Audio Media Source = Feel This Moment by Pitbull (ft. Christina Aguilera) (Amazon MP3)
#
#  REQUIRED AVISYNTH PLUGINS & SCRIPTS
#    Advanced Editing Script (http://www.l33tmeatwad.com/advanced-editing-script)
#    KenBurnsEffect (http://forum.doom9.org/showthread.php?t=135776)
#    NicAudio (http://nicaudio.codeplex.com/)
#    
###########################################################################################

movie2DHD = avisource("D:\Source\Tangled\tangled_2D_HD.avi").advtrim(19,85382,false,85385,0)
#movie3DLeft = avisource("D:\Source\Tangled\_ENCODE_3D_MOVIE.avi").crop(0,0,-1920,0).crop(40,0,-60,0)
#movie3DRight = avisource("D:\Source\Tangled\_ENCODE_3D_MOVIE.avi").crop(1920,0,0,0).crop(40,0,-60,0)
movie = movie2DHD
black = BlankClip(movie)
white = BlankClip(movie, color=$FFFFFF)

##OPENING##
op1 = movie.advtrim(12004,12043,false,12102,12122)+movie.trim(12395,12420).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101.5,startalign=9,endalign=1)+movie.trim(12470,12486).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101)+movie.trim(12616,12628)+movie.advtrim(12826,12848,fps1=18).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100)
op2 = movie.trim(12848,12873)+movie.trim(12895,12905).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100)+movie.trim(12969,12990)
op3 = movie.advtrim(13215,13240,false,fps1=18,13241,13247,false,13248,13260,false,13308,13326)
op4 = dissolve(movie.trim(13408,13450),movie.advframes(3,22600)+dissolve(movie.trim(22600,22661),movie.trim(22652,22661).tweak(cont=5,bright=3),white.trim(0,9),10),20)

opening = op1+op2+op3+op4

##VERSE 1##
onedayorg = movie.trim(7384,7409).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102, endzoomfactor=100)
oneday1 = dissolve(white.trim(0,5),onedayorg,movie.trim(7168,7241).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100, endzoomfactor=105),movie.trim(7325,7365).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100, endzoomfactor=103),movie.trim(11806,11851).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104, endzoomfactor=100),5)
illbe1 = dissolve(movie.trim(11904,11955).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104, endzoomfactor=100),movie.trim(22374,22421).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102, endzoomfactor=100),movie.trim(22493,22535).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=101, endzoomfactor=100),movie.trim(11452,11492).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100, endzoomfactor=102,startalign=2,endalign=2),5)
ohv11 = dissolve(movie.trim(11635,11717).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100, endzoomfactor=105,startalign=6,endalign=3),movie.trim(8805,8826).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=103, endzoomfactor=100)+movie.trim(8827,8853).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102, endzoomfactor=100)+movie.trim(8854,8895).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102, endzoomfactor=100),5)
feelthisv11 = movie.trim(9440,9523).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104,endzoomfactor=100)+movie.trim(9835,9855).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=102)+movie.advtrim(10482,10512,false,9911,9950,fps2=14)

verse1 = dissolve(oneday1,illbe1,5)+ohv11+feelthisv11

##CHORUS 1##
c11 = movie.advtrim(9951,9964,fade1=5,false,22816,22821,false,22822,22849,fps3=18,false,22850,22860,fps4=13,false,22861,22870,fps5=18,false,22871,22885,fps6=15)
c12 = movie.trim(22967,22976).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100, startalign=6,endalign=4)+movie.trim(23242,23257).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101, startalign=6,endalign=1)+movie.trim(23322,23332).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101, startalign=4,endalign=6)
c13 = movie.advtrim(9542,9546,fps1=14,false,9546,9554).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=101,endzoomfactor=100,startalign=6,endalign=6)+movie.trim(9562,9570).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100.8,endzoomfactor=100,startalign=6,endalign=5)+movie.advtrim(9592,9633,fps1=14).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100,startalign=6,endalign=4)+movie.trim(9965,9975).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100.8,endzoomfactor=100,startalign=3,endalign=5)+movie.trim(10009,10021).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=102,startalign=4,endalign=6)+movie.trim(10028,10042).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100,startalign=6,endalign=4)
c14 = movie.advtrim(23488,23505,fps1=18).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100,startalign=5,endalign=8)+movie.trim(23548,23558).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100.8,endzoomfactor=100,startalign=3,endalign=5)+movie.trim(24098,24118)+movie.trim(24297,24308).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101,startalign=3,endalign=7)+movie.advtrim(24260,24282,fps1=18).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104,endzoomfactor=101,startalign=6,endalign=4)+movie.trim(24342,24352).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100.8,endzoomfactor=100,startalign=3,endalign=5)
feelthisc1 = movie.advtrim(10177,10196,false,10198,10214)
c15 = dissolve(movie.trim(10099,10141).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100,startalign=4,endalign=6),movie.trim(24409,24452)+movie.trim(24576,24600)+movie.trim(24886,24910)+movie.trim(25060,25080)+movie.trim(24938,24960)+movie.trim(25094,25129)+movie.trim(25023,25033)+movie.trim(25183,25196),5)
c16 = movie.advtrim(26610,26642,fps1=18,false,27031,27042,fps2=18,false,26692,26708)+movie.trim(27204,27229).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=102,startalign=6,endalign=4)+movie.advtrim(27232,27240,false,27241,27255,fps2=18,false,27256,27279,false,27280,27310,fps4=20).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104,endzoomfactor=100,startalign=4,endalign=6)

chorus1 = c11+c12+c13+c14+feelthisc1+c15+c16

##VERSE 2##
reporting = movie.advtrim(27575,27613,false,27640,27683,false,27808,27839,fade3=5,false,27844,27863)+movie.advtrim(27935,27962,false,27963,27968,fps2=30).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104,endzoomfactor=100,startalign=5,endalign=5)
longway = movie.advtrim(28082,28095,false,28151,28158,fps2=18,false,28159,28182,false,28340,28347,false,28315,28330)
alldayv2 = movie.trim(28596,28613)+movie.trim(28851,28871).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101.5,startalign=5,endalign=4)+movie.trim(29344,29364).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101)
partyv2 = movie.trim(29492,29502)+movie.trim(29520,29530).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=100.5)+movie.advtrim(29611,29631,false,29648,29663,fps2=18)
readv2 = movie.advtrim(29889,29909,false,30073,30083,false,30241,30281)
hookedv2 = movie.trim(35689,35699).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=100.5,startalign=5,endalign=4)+movie.advtrim(35852,35882,fps1=12).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100)+movie.trim(35952,35969)
seemev2 = movie.advtrim(36650,36668,fps1=18,false,36676,36691,false,36764,36784)+movie.trim(38047,38060).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=101,endzoomfactor=100,startalign=4,endalign=5)+movie.trim(38008,38027)+movie.advframes(2,38027)
ownitv2 = kenburnseffect(ResizeMethod="lanczos4resize", movie.trim(39668,39675)+movie.advframes(3,39675),startzoomfactor=100,endzoomfactor=100.6,startalign=5,endalign=5)+movie.trim(39697,39715).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101,startalign=5,endalign=6)

verse2 = reporting+longway+alldayv2+partyv2+readv2+hookedv2+seemev2+ownitv2

##CHORUS 2##
verse2end = movie.advtrim(39756,39904,fps1=12,false,39912,39964,fps2=12)
onedayc2 = movie.trim(40365,40382).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=106,endzoomfactor=102,startalign=4,endalign=6)+movie.advtrim(40410,40439,false,40440,40448).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=106,endzoomfactor=100,startalign=5,endalign=8)
lightisc2 = movie.advframes(3,40557)+movie.advtrim(40558,40560,fps1=30)+movie.advframes(25,40560)
inmyc2 = movie.trim(40845,40866).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101,startalign=6,endalign=1)+kenburnseffect(ResizeMethod="lanczos4resize", movie.trim(40867,40877)+movie.advframes(5,40877),startzoomfactor=100,endzoomfactor=101,startalign=6,endalign=4)
castlec2 = movie.trim(41145,41180)
goldenc2 = movie.trim(41383,41407)+movie.advframes(3,41407)
butuntilc2 = movie.advframes(2,41408)+movie.advtrim(41408,41457,fps1=12)
gatesc2 = movie.advtrim(41473,41513,fade1=5,false,41514,41533)
ijustc2 = dissolve(movie.trim(41582,41609).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=103,startalign=4,endalign=6),movie.trim(41890,41911).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=103,startalign=5,endalign=2),5)
feelthisc2 = movie.trim(42368,42388).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101,startalign=3,endalign=4)
momentc2 = movie.trim(42938,42967).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=102,startalign=5,endalign=2)

woahc21 = movie.advtrim(fadeA=5,43360,43400,false,43530,43553,false,43590,43627)
ijustc21 = movie.advframes(2,44067)+movie.trim(44067,44093)+movie.advframes(2,44093)
woahc22 = dissolve(movie.trim(43936,43996),kenburnseffect(ResizeMethod="lanczos4resize", movie.trim(44178,44216)+movie.advframes(4,44216),startzoomfactor=103,endzoomfactor=100,startalign=6,endalign=4),5)
ijustc22 = movie.advtrim(44306,44350,false,44466,44487,false,44717,44748)
feelthisc21 = movie.trim(44924,44941)
momentc21 = movie.trim(45015,45039)

chorus2p1 = dissolve(verse2end.kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104,endzoomfactor=100,startalign=4,endalign=6),onedayc2,lightisc2.kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100,startalign=5,endalign=2),inmyc2,castlec2.kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=102,startalign=6,endalign=4),goldenc2.kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101.5,startalign=6,endalign=3),butuntilc2.kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=102.5,startalign=6,endalign=3),gatesc2.kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104,endzoomfactor=100,startalign=3,endalign=7),5)+ijustc2+feelthisc2+dissolve(momentc2,woahc21,ijustc21,woahc22,ijustc22,feelthisc21,momentc21,5)

c21 = movie.advtrim(45196,45207,false,45208,45221,fps2=18,false,45222,45224).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100)+movie.trim(45238,45248).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101,startalign=2,endalign=8)+movie.trim(45378,45388)+movie.trim(45610,45625).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104,endzoomfactor=100,startalign=6,endalign=1)
c22 = movie.advtrim(45990,46025,fps1=12).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104,endzoomfactor=100,startalign=2,endalign=8)+movie.trim(46669,46681).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100.8,endzoomfactor=100,startalign=2,endalign=8)+movie.trim(46553,46589).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=106,endzoomfactor=100,startalign=2,endalign=8)
c23 = movie.trim(46300,46309).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=101,endzoomfactor=101.8,startalign=6,endalign=6)+movie.trim(46510,46522).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101,startalign=4,endalign=6)+movie.trim(46442,46453).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=101,endzoomfactor=101.5,startalign=4,endalign=4)+movie.advtrim(49144,49168,fps1=15,false,49199,49210,false,49394,49404,false,49493,49501)+movie.trim(46705,46730).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=103,endzoomfactor=101,startalign=3,endalign=7)+movie.trim(46750,46762).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=101,startalign=5,endalign=7)
c24 = dissolve(movie.trim(46849,46888).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=102,startalign=5,endalign=5),movie.trim(47043,47093).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=101,endzoomfactor=103,startalign=5,endalign=6),5) 

chorus2 = chorus2p1+c21+c22+c23

##VERSE 3##
seefuturev3 = dissolve(c24,movie.trim(48537,48562).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=101,endzoomfactor=100,startalign=6,endalign=6),movie.advtrim(49853,49894,fps1=16),movie.advtrim(53189,53213,fps1=12),5)
makessensev3 = movie.advtrim(53499,53508,fps1=16,false,53571,53587,fps2=18,false,53597,53624,fps3=8)
makedollarsv3 = movie.advtrim(57092,57106,fps1=12,false,57120,57130,false,60405,60415,false,60460,60465,false,60470,60485,false,60546,60573,fps6=18)
geniusv3 = dissolve(movie.trim(60620,60635)+kenburnseffect(ResizeMethod="lanczos4resize", movie.trim(60655,60677)+movie.advframes(5,60678),startzoomfactor=108,endzoomfactor=100),movie.trim(57603,57623).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=100)+movie.trim(60963,60976),5)
brilliantv3 = movie.advtrim(61144,61158,fps1=18,false,61204,61250,fps2=10,false,61251,61267)+movie.trim(61394,61415)
lostv3 = dissolve(movie.trim(61758,61774).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=102),movie.trim(45681,45696),5)
farv3 = movie.advtrim(85799,85814,fps1=18,false,86022,86060,fps2=12,false,86177,86188,false,86398,86436,fps4=12,false,87918,87994,fps5=12,fade5=8,false,88505,88550,fade6=8,false,89045,89087)
travelv3 = movie.advtrim(89583,89603,fps1=16,false,89610,89625,fps2=16,false,89641,89651,false,89668,89696)
enjoyv3 = dissolve(movie.trim(89877,89907),movie.trim(92422,92480).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=108,endzoomfactor=101,startalign=8,endalign=2),movie.trim(93240,93280),movie.trim(95128,95218),movie.trim(95421,95518).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=102,endzoomfactor=108,startalign=8,endalign=2),movie.trim(96400,96430).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=103,endzoomfactor=100,startalign=5,endalign=5)+movie.trim(96435,96500),8)

verse3 = seefuturev3+makessensev3+makedollarsv3+geniusv3+brilliantv3+lostv3+farv3+travelv3+enjoyv3


##CHORUS 3##
lampblur1 = movie.advframes(1,100462).gaussianblur(6,6,y=3, u=3, v=3)
lampblur2 = movie.advframes(1,100463).gaussianblur(12,12,y=3, u=3, v=3)
lampblur3 = movie.advframes(1,100464).gaussianblur(18,18,y=3, u=3, v=3)
lampblur4 = movie.advframes(1,100465).gaussianblur(24,24,y=3, u=3, v=3)
lampblur5 = movie.advframes(1,100466).gaussianblur(30,30,y=3, u=3, v=3)
lampblur6 = movie.advframes(1,100467).gaussianblur(36,36,y=3, u=3, v=3)
lampblur7 = movie.advframes(1,100468).gaussianblur(42,42,y=3, u=3, v=3)
lampblur8 = movie.advframes(1,100469).gaussianblur(48,48,y=3, u=3, v=3)
lampblur9 = movie.advframes(1,100470).gaussianblur(54,54,y=3, u=3, v=3)
lampblur10 = movie.advframes(1,100471).gaussianblur(60,60,y=3, u=3, v=3)
lampblur11 = movie.advframes(1,100472).gaussianblur(66,66,y=3, u=3, v=3)
lampblur = lampblur1+lampblur2+lampblur3+lampblur4+lampblur5+lampblur6 #lampblur7+lampblur8+lampblur9+lampblur10+lampblur11

danceblur1 = movie.advframes(1,90722).gaussianblur(70,70,y=3, u=3, v=3)
danceblur2 = movie.advframes(1,90723).gaussianblur(50,40,y=3, u=3, v=3)
danceblur3 = movie.advframes(1,90724).gaussianblur(30,10,y=3, u=3, v=3)
danceblur4 = movie.advframes(1,90725).gaussianblur(10,10,y=3, u=3, v=3)
danceblur = danceblur1+danceblur2+danceblur3+danceblur4

feelc31 = dissolve(movie.trim(96573,96598),movie.trim(96811,96848),movie.trim(97053,97078),movie.trim(97156,97186),movie.trim(97187,97255),movie.advtrim(98400,98489,fps1=12),movie.advtrim(98994,99022,false,99030,99064),movie.trim(99127,99194),movie.advtrim(99887,99908,false,99912,99928,false,99929,99958,fps3=12,false,99959,99989),movie.trim(100446,100461)+lampblur,8)
c31 = dissolve(kenburnseffect(ResizeMethod="lanczos4resize", danceblur+movie.trim(90726,90762),startzoomfactor=104,endzoomfactor=100),movie.trim(90929,90961),5)+movie.advtrim(91021,91035,false,91039,91067,false,91076,91098,false,91150,91162,false,91169,91193)
c32 = movie.advtrim(91199,91240,fps1=17).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=104,endzoomfactor=102,startalign=4,endalign=5)+movie.trim(91249,91273)
c33 = movie.advtrim(91471,91481,false,91489,91506,false,91509,91557,false,91558,91570,false,91577,91599)
c34 = dissolve(movie.trim(91356,91382).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=101,endzoomfactor=103,startalign=5,endalign=6)+movie.trim(91394,91415).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=103,endzoomfactor=100),movie.advtrim(91608,91638,false,91639,91673),movie.trim(91682,91707).kenburnseffect(ResizeMethod="lanczos4resize", startzoomfactor=100,endzoomfactor=101),movie.trim(91835,91861)+movie.advtrim(91862,91864,false,91865,91885,fps2=16,false,91886,91889),5)
c35 = movie.advtrim(91890,91945,false,92101,92130,false,92131,92159,false,92160,92197,false,92198,92276)

chorus3 = feelc31+c31+c32+dissolve(c33,c34,5)+c35


##FINAL OUTPUT##
final = opening+verse1+chorus1+verse2+chorus2+verse3+chorus3.fadeout(35)+black.trim(0,19)
audio = nicmpg123source("03 - Feel This Moment.mp3").resampleaudio(48000)
finala = AudioDub(final,audio)
return finala

l33t Script

File Name: l33tscript_v1.1.avsi

The name is only l33t Script because I didn't really put any effort into naming it and all of the functions are prefixed with l33t as to avoid any future conflicts with other future AviSynth functions. This script was created to help me edit AMVs directly in AviSynth and to make a lot of things easier to do when it comes to trimming clips. This is intended for more advanced users, I didn't spend much time on explaining because users advanced enough to use it will understand with what is provided below.

Release Notes

Version 1.1 (5-11-2013)

  • Added l33tdissolve() which allows for cross fades between clips of the same video.
  • Fixed error with clip 13 in l33tclips() & l33tclips2().

Version 1.0 (10-25-2012)

  • First public release.