Expression to skip every 8th frame

Scripting for After Effects

Expression to skip every 8th frame

Postby Eddykins on 12/15/2017, 11:06 am

I need an expression that will automatically skip every 8th frame. This is for DJI Mavic Pro footage in which every 8th frame is an I-frame with noise in it. It makes the video flicker so I want to cut it out. I have found some expressions for the Time Remap function but they didn't do exactly what I want. Do any of you know an expression which would skip or delete every 8th frame in a video?
Eddykins
 
Posts: 4
Joined: 12/28/2008, 3:19 pm
Twitter: Eddykins

Re: Expression to skip every 8th frame

Postby star+circle on 12/17/2017, 9:28 am

Time remap expression:

Code: Select all
t =thisLayer.timeToFrames();
t = Math.floor(t/8)+t;
t*thisComp.frameDuration


since it's not likely to skip the right frame that way, you'll need to add a constant to the second line:

Code: Select all
t = Math.floor((t+n)/8)+t;


n being the constant (offset) between 0 and 8 that tells which frame of the 8 to skip.
star+circle
 
Posts: 729
Joined: 12/6/2014, 3:07 pm
Location: Finland

Re: Expression to skip every 8th frame

Postby Eddykins on 12/18/2017, 12:04 pm

Thank you so much!!!
Eddykins
 
Posts: 4
Joined: 12/28/2008, 3:19 pm
Twitter: Eddykins


Return to After Effects Expressions