ADOBE PREMIERE PRO: Tutorials Forum Articles Creative Cloud Debate

Start time offset with scripted time manipulation in After Effects from Premiere Pro clip

COW Forums : Adobe Premiere Pro

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nicklas Johnson
Start time offset with scripted time manipulation in After Effects from Premiere Pro clip
on Mar 30, 2020 at 1:05:00 am

I've found a few posts that have perhaps gotten me closer to the answer, but I'm not quite there; any help is greatly appreciated. I'm a total novice at this, so thank you in advance for bearing with me.

I'm working on a "stuttering" effect to be timed along to a musical composition, which a friend helped me implement in a bit of script, which I apply by selecting a clip in PP, choosing "Replace with After Effects Composition" and then in After Effects, I Enable Time Remapping, and alt-click the stopwatch to insert the script to apply the stutter effect.

The problem is that although AE knows about the start time of the clip in the composition (e.g., 1:31:04), I haven't been able to make the script aware of this offset, so it will grab frames from other parts of the clip's file which are not otherwise visible either in PP or AE. From the script, startTime and inPoint are both 0 (I had expected one or the other of those to be 1:31:04, for example, but they seem to always be 0).

Is there a way to get at either the frame number of the start of the comp relative to the file it's coming from, or the precise time of the same?

If anyone is interested, here's the bit of script I'm using to remap time:

var songTempoBpm = 109;
var beatsPerChunk = 3; // 6/8 time signature
var chunkSize = 60 * beatsPerChunk / songTempoBpm / thisComp.frameDuration;
var duration = timeToFrames(thisComp.duration);
var timelineFrame = timeToFrames(); // ** This is where the offset to the beginning of the comp probably needs to be offset ** //
var sourceFrame = duration - Math.floor(timelineFrame / chunkSize + 1) * chunkSize + (timelineFrame % chunkSize);

(In effect it re-orders the clip to play out in measure-length chunks, in reverse order, from the end of the clip back to the start.)

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 All Rights Reserved