gists/spddiff.avs

92 lines
2.3 KiB
Text
Raw Normal View History

2013-02-26 02:41:48 -08:00
function DiffClip(clip c, int diff)
{ BlankClip(c, diff).Subtitle(String(-diff), align=5, size=c.Height/8) }
function PadWithDiff(clip c, int len)
{ c.FrameCount < len ? c + DiffClip(c, len - c.FrameCount) : c }
2013-02-26 03:39:15 -08:00
function DualMonoToStereo(clip left, clip right)
{ MergeChannels(ConvertToMono(left), ConvertToMono(right)) }
2013-02-26 02:41:48 -08:00
function MergeHoriz(clip left, clip right)
2013-02-26 03:39:15 -08:00
{
v = Overlay(AddBorders(left, 0, 0, right.Width, 0), right, left.Width, 0)
return AudioDub(v, DualMonoToStereo(left, right))
}
2013-02-26 02:41:48 -08:00
function MergeVert(clip top, clip bottom)
2013-02-26 03:39:15 -08:00
{
v = Overlay(AddBorders(top, 0, 0, 0, bottom.Height), bottom, 0, top.Height)
return AudioDub(v, DualMonoToStereo(top, bottom))
}
2013-02-26 02:41:48 -08:00
function Cmp(clip left, clip right)
{
frames = max(left.FrameCount, right.FrameCount)
left = PadWithDiff(left, frames)
right = PadWithDiff(right, frames)
return MergeHoriz(left, right)
}
# http://tasvideos.org/1072S.html
2013-02-26 03:39:15 -08:00
AviSource("snes9x\Movies\old.avi")+\
AviSource("snes9x\Movies\old_part2.avi")+\
AviSource("snes9x\Movies\old_part3.avi")+\
AviSource("snes9x\Movies\old_part4.avi")
2013-02-26 02:41:48 -08:00
Trim(0, 38409)
AddBorders(0,0,16,0)
global old = last
# http://tasvideos.org/3346S.html
2013-02-26 03:39:15 -08:00
AviSource("snes9x\Movies\new.avi")+\
AviSource("snes9x\Movies\new_part5.avi")+\
AviSource("snes9x\Movies\new_part6.avi")+\
AviSource("snes9x\Movies\new_part7.avi")
2013-02-26 02:41:48 -08:00
Trim(0, 37569)
global new = last
# compare by slice
function x(int oldStart, int oldEnd, int newStart, int newEnd)
{ Cmp(Trim(old, oldStart, oldEnd), Trim(new, newStart, newEnd)) }
# compare by split (start is last split)
global prevOldSplit = 0
global prevNewSplit = 0
function s(int oldSplit, int newSplit)
{
ot = prevOldSplit
nt = prevNewSplit
global prevOldSplit = oldSplit + 1
global prevNewSplit = newSplit + 1
return x(ot, oldSplit, nt, newSplit)
}
s(01498,01497)+\
s(04115,04184)+\
s(06856,06527)+\
s(08027,07668)+\
s(09017,08658)+\
s(09207,08847)+\
s(10000,09615)+\
s(11601,11212)+\
s(14217,13817)+\
s(16319,15911)+\
s(17425,16999)+\
s(17783,17350)+\
s(18906,18470)+\
s(19091,18655)+\
s(19638,19149)+\
s(20338,19834)+\
s(22816,22312)+\
s(23798,23271)+\
s(26013,25461)+\
s(26930,26345)+\
s(29007,28374)+\
s(29192,28559)+\
s(29486,28855)+\
s(29900,29162)+\
s(30072,29369)+\
s(30720,29894)+\
s(31504,30639)+\
s(34100,33232)+\
s(38158,37235)+s(0,0) # end of input, then bowser dead