Prettz
19th September 2006, 06:55
I'd really like to be able to interleave ranges of frames from 2 different clips, like the Interleave() function, but instead of the sequence being like "a1, b1, a2, b2, a3, b3..." I want it to be like "a1, a2, a3, b1, b2, b3, a4, a5, a6, b4, b5, b6...".
The reason I want to do this is because I'm analyzing the effects of different filter chains on the noise in a film, but Interleave()'s frame-by-frame behavior isn't helping. The noisiness in a certain scene is so violent and abrupt that a background area of the picture between two frames bear no resemblence to one another. What I need to see is the difference in the the motion of the noise between the two filter chains. So I want to have it giving me 15 or so frames of one clip, then the same 15 frames of the other, then the next 15 frames of the first clip, ect.
After looking at Animate for a while I concluded it can't do what I want it to.
I've now tried making 2 different versions of a recursive function:
function MultiInterleave(clip c1, clip c2, int start) {
return ( c1.Trim(start,start+14) + c2.Trim(start,start+14) \
+ MultiInterleave(c1,c2,start+15) ) //tail recursion is supposed to be better
}
function MultiInterleave(clip c1, clip c2, int start) {
return (start >= 100000 ? \
(c1.Trim(start,start+14) + c2.Trim(start,start+14)) : \
(c1.Trim(start,start+14) + c2.Trim(start,start+14) \
+ MultiInterleave(c1,c2,start+15)) )
}
MultiInterleave(a.Subtitle("a"), b.Subtitle("b"), 0)
The 100000 is just an arbitrary limit I hoped might limit memory usage.
Both of these functions cause VirtualDubMod to silently crash just a second after I open the script. There doesn't seem to be any way I can tell if it was caused by memory because it closes too fast.
Is there any other way to interleave two clips together like I want to, and that doesn't crash?
The reason I want to do this is because I'm analyzing the effects of different filter chains on the noise in a film, but Interleave()'s frame-by-frame behavior isn't helping. The noisiness in a certain scene is so violent and abrupt that a background area of the picture between two frames bear no resemblence to one another. What I need to see is the difference in the the motion of the noise between the two filter chains. So I want to have it giving me 15 or so frames of one clip, then the same 15 frames of the other, then the next 15 frames of the first clip, ect.
After looking at Animate for a while I concluded it can't do what I want it to.
I've now tried making 2 different versions of a recursive function:
function MultiInterleave(clip c1, clip c2, int start) {
return ( c1.Trim(start,start+14) + c2.Trim(start,start+14) \
+ MultiInterleave(c1,c2,start+15) ) //tail recursion is supposed to be better
}
function MultiInterleave(clip c1, clip c2, int start) {
return (start >= 100000 ? \
(c1.Trim(start,start+14) + c2.Trim(start,start+14)) : \
(c1.Trim(start,start+14) + c2.Trim(start,start+14) \
+ MultiInterleave(c1,c2,start+15)) )
}
MultiInterleave(a.Subtitle("a"), b.Subtitle("b"), 0)
The 100000 is just an arbitrary limit I hoped might limit memory usage.
Both of these functions cause VirtualDubMod to silently crash just a second after I open the script. There doesn't seem to be any way I can tell if it was caused by memory because it closes too fast.
Is there any other way to interleave two clips together like I want to, and that doesn't crash?