-
Expression to loop but trim last couple of frames?
I have about 200+ videos. Each needs to be looped X amount of times. I have an expression (see below) that allows me to do this and it works just fine for [most] videos. Unfortunately, some videos have a couple of frames of black at the tail end so when I loop them using the expression, those black frames get included therefore they flash every time the loop happens.
The only way I know to prevent this is to trim the black from the videos in FCPX and re-export them.
I’m wondering if there’s a better expression so I don’t have to trim and re-export in FCP.
I’m on a tight deadline :/
Thanks for any help!
nLoops = 100;
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