On Jul 26, 2011, at 12:36 PM, Peter Litwinowicz wrote: As an example, you create a 1920x1080p30 template that's 10 seconds long in Motion with your effect applied. You bring it into FCPX and apply it to a 20 second interlaced clip. You'll get called to render with frame times like 0.0, 0.25, 0.5, 0.75, 1.0, etc. At time 0.25, you're actually getting the field at time 0.5 in the footage's local time base, but your plugin has no way of knowing that. So if you ask for frame 1.25 by calling the temporal API, you'll get the field at time 1.5 in the footage's local time base.
Woah, so if I ask for frame 1.25 when the current time is .25, I get the next frame in the input? What happens when I ask for frame 1.25 when I'm at frame 35? This automagical solution doesn't allow me to access particular frames on the timeline in a predictable way (and when we are retiming this is all-too-crucial). Is this automagical time adjustment algorithm documented anywhere? (keep reading my next statement below).
If you ask for frame 1.25 when at frame 35, we'll take 35-1.25=33.75, convert frame 35 into FCPX time, subtract 33.75 from that, and give you that frame. So you'll get the frame that is 33.75 frames before the current one. In other words it figures out the difference in frames and applies that in FCPX's time base. So yes, if you want to access a specific frame number, that no longer works as you'd expect. (But of course, the specific frame number is meaningless to your plug-in in this case, so it doesn't really matter.) - Similarly, if you guys do fps related conversion, I still need to get to the next frame of the input sequence in FCP, not the next supposed frame in the motion template based on its number of frames and fps.
I think what I wrote above should help. Does it?
Well, I see where you might think it helps.. Did you see my followup email that if I ask for time 7.0 of a 10:01 duration clip (301 frame, 29.97fps), I get anywhere from frame 72 to frame 42 returned to me depending on where I am on the timeline. So what you are doing to help is not anything I can count on, at least as far as you've explained it so far. Right now it seems you are trying to help us in a way that is not steady and reliable. Any chance you can post pseudo-code about what you are doing internally?
Does my description above make it any more helpful? Darrin
|