This version ought to be easier for creating a full comparison clip:
global clip1 = Open("a.avi", "author clip1")
global clip2 = Open("b.avi", "author clip2")
global FrameDiff = 0
global FrameGain = 0
global final = false
Section( 0, 362, 0, 360)
Section(1829, 2578, 1829, 2515)
# ...
final
function AddBlankClip(clip clip1, clip clip2) {
max = Max(clip1.FrameCount, clip2.FrameCount)
return (clip1.FrameCount != max) ? (clip1 + BlankClip(clip1, length=max-clip1.FrameCount)).FreezeFrame(clip1.FrameCount, max - 1, clip1.FrameCount - 1) : clip1
}
function Format(clip old, clip new) {
left = AddBlankClip(old, new)
right = AddBlankClip(new, old)
AudioDub(StackHorizontal(left, right), MixAudio(left, right, 1.0, 0.0))
Subtitle("Frames gained: " + String(FrameGain, "%.0f") + " (" + String(FrameDiff, "%05.0f") + ")", align=2, size=10)
}
function FormatTime(int ms) {
s = ms / 1000
ms = ms % 1000
m = s / 60
s = s % 60
h = m / 60
m = m % 60
String(m, "%02.0f") + ":" + String(s, "%02.0f") + "." + String(ms, "%03.0f")
}
function Open(string FileName, string Title) {
v = DSS2(FileName).ConvertToRGB32
a = DirectShowSource(FileName, video=false)
AudioDub(v, a)
PointResize(Width * 2, Height * 2)
AddBorders(0, 20, 0, 20)
Subtitle(Title, align=2, text_color=$00FFFFFF)
ScriptClip("""Subtitle("Frame: " + String(current_frame) + "\nTime: " + FormatTime(Round(Float(current_frame * 1000) * Float(FrameRateDenominator) / Float(FrameRateNumerator))), text_color=$00FFFFFF, lsp=1, size=10.0)""")
ConvertToYV24(matrix="PC.601", chromaresample="point" )
ConvertToYV12(matrix="PC.601", chromaresample="lanczos4")
}
function Section(int clip1_a, int clip1_b, int clip2_a, int clip2_b) {
old = clip1.Trim(clip1_a, clip1_b)
new = clip2.Trim(clip2_a, clip2_b)
tmp = Format(old, new)
global final = IsBool(final) ? tmp : final + tmp
global FrameDiff = old.FrameCount - new.FrameCount
global FrameGain = FrameGain + FrameDiff
}