-
Using expression to loop layer and trim Work Area?
I have about 300 short videos of varying lengths ranging from 00:00:00:07 (7 frames) to 00:00:33:02 (33 seconds and 2 frames). I have to loop most of them because they are too short.
I have done some research and found that I can use expressions to do looping. For example, the expression below will loop the layer 10 times.
Also, by design the expression will freeze the video that’s past the last loop, therefore, I will need to trim the work area at the location of the last frame of the last loop. What would be the easiest/quickest way to do this?
Is it possible to perhaps add something to the expression so that a marker is added to that last frame of the last loop so I can quickly find it and do the trim?
Lastly, is there a way to add something to the expression that can automatically trim the work area? I don’t think so but I figured I’d ask.
Any other techniques would be appreciated since I have so many videos to deal with and my carpal is acting up. : )
Thank you for any help.
nLoops = 10;
if (numKeys > 1){
loopDur = key(numKeys).time - key(1).time;
n = Math.floor((time - key(1).time)/loopDur);
if (n < nLoops){
t = (time - key(1).time)%loopDur;
valueAtTime(key(1).time + t);
}else{
valueAtTime(key(numKeys).time);
}
}else
value;Xavier