Log in

View Full Version : Script to switch between videos


magiblot
27th November 2016, 10:33
Hi there. I'm searching for a script or function which allows me to do the following.

Input: two clips with the same frame size and rate, aligned in time previously. One of them is the source and the other is the filtered video, or both are filtered videos with different settings.

Output: Starts playing one of the videos, and every x frames, switches to the other video.

Thus, to give an example, for x=1 it would be useful for a frame-by-frame comparison.

This could be done trimming both videos several times, but I am wondering if there is any easier solution.

I have looked in the "External filters" section and googled for a while (I have the feeling I once read an answer with a similar script), but I found nothing. I hope you can lend me a hand.

Thanks.

sneaker_ger
27th November 2016, 13:11
for x=1 it's very simple:
Interleave (http://avisynth.nl/index.php/Interleave)(clip_a, clip_b)

raffriff42
27th November 2016, 13:21
here's one for x=30:
Last=<something>
I=Invert ## or some other filter
ConditionalFilter (http://avisynth.nl/index.php/ConditionalFilter)(Last, Last, I, "(current_frame/30)%2", "==", "0")

magiblot
27th November 2016, 17:15
That's exactly what I was looking for. Thanks.