Log in

View Full Version : "Weaving" multiple sources?


TomArrow
2nd January 2020, 15:06
I wanna weave multiple different encodes to export as an image sequence for AI upscale training.

Specifically I wanna use the n-th frame from the nth source, so:
- 1st frame from 1st source
- 2nd frame from 2nd source
- ...
- 6th frame from 6th source
- 7th frame from 1st source
- 8th frame from 2nd source
- ...

How can I do this? I know that I could use something like SelectEvery for the opposite direction, but how can I do this?

I figure I could just divide the framerate by 6 (or number of sources) for each clip to discard 5 out of 6 frames, while using trim to take care of the offset, but that still leaves me with the issue of having to weave them.

wonkey_monkey
2nd January 2020, 15:13
a = avisource("clip1.avi")
b = avisource("clip2.avi")
c = avisource("clip3.avi")
d = avisource("clip4.avi")
e = avisource("clip5.avi")
f = avisource("clip6.avi")

interleave(a, b, c, d, e, f)

TomArrow
2nd January 2020, 15:41
Excellent, thank you!

ajp_anton
11th January 2020, 17:10
a = avisource("clip1.avi")
b = avisource("clip2.avi")
c = avisource("clip3.avi")
d = avisource("clip4.avi")
e = avisource("clip5.avi")
f = avisource("clip6.avi")

interleave(a, b, c, d, e, f)


That's not what was asked. 2nd frame of the result should be the 2nd frame of 2nd clip, but in your example it would be the 1st frame of the 2nd clip.

But it's easily fixed, I guess. One is to add selectevery's to every source:
selectevery(6,0)
selectevery(6,1)
...
selectevery(6,5)

Another is to add a selectevery to the very end:
With 6 sources, the loop is 6^2=36 frames and each jump is 6+1=7 frames (until the loop repeats):
selectevery(36,0,7,14,21,28,35)
I believe this will be correct?