Keyframe Interpolation problem

Tech Diver wrote on 4/25/2006, 9:19 AM
I am hoping that someone might have a good suggestion on how to overcome my problem regarding the interpolation between keyframes.

I am panning a scene that starts out with slow movent and gradually increases at a steady rate. In other words, the panning is accelerating. For example, the keyframes might have the following values for X Center: 0, 50, 100, 400, 800. My problem is that when the video plays, the change from one keyframe speed segment to the other is quite noticeable. Note that I am using Linear interpolation. If I use any other interpolation, it is far worse. For example, using the Smooth interpolation will cause the panning to slow down at each keyframe and then speed up. The term Smooth is really a misnomer.

What I really need is a Bezier curve sort of interpolation to smooth the transitions. Some keyframe-based products (like the Wax plugin) actually show you the curve path between keyframes and allow you to adjust Bezier control points to get exactly what you want. For now I have inserted additional keyframes with linear interpolation to make the transitions less noticeable. Any help on simplifying this would be appreciated.

Comments

JohnnyRoy wrote on 4/25/2006, 9:28 AM
You want to set the smoothness on each keyframe (in the keyframe properties) to zero (0.000) This will stop them from easing in and out. You can use my script Unsmooth Keyframes to do this. Just select the events you want to unsmooth and run the script.

I you are unfamiliar with running scripts, read the Using Scripts in Sony Vegas Software tutorial first.

~jr
Tech Diver wrote on 4/25/2006, 10:19 AM
Thank you JohnnyRoy for your suggestion. However, I think you may have misunderstood what I am trying to do. I do not want to eliminate smoothing. Instead, I want a different type of smoothing where there is a continuos interpolation from one keyframe to the next with no "dwell" or SUDDEN change in speed. Again, I want a Bezier-like interpolation to achieve a GRADUAL change in speed.

The Smooth interpolation as it currently is implemented is excellent for when you change directions (pan right, then left), because it decelerates, stops, then accelerates. However, this approach does not work if the keyframed panning segments are in the same direction.

The script you sent will be useful in other projects. It's just not what I need for this one. Thanks again, and if you have other thoughts on how to solve my current problem I would greatly appreciate the help.
johnmeyer wrote on 4/25/2006, 10:24 AM
I don't think there is any easy way to get what you want. Keyframe interpolation is linear, and there are no exponential controls that I know of. I am not aware of any kind of kludge or workaround, unless the velocity envelope on one track could somehow be used to keyframe the fx on another track. The velocity events have a limited "exponential" capability by right-clicking and changing the fade type.
Former user wrote on 4/25/2006, 10:31 AM
Do you need all of those keyframes? Can you get by with just a beginning and ending keyframe?

IF you do need more keyframes, can you use a mixture of PAN/CROP and TRACK MOTION to obtain the effect?

Dave T2
johnmeyer wrote on 4/25/2006, 12:16 PM
Do you need all of those keyframes? Can you get by with just a beginning and ending keyframe?

I think he does because he is trying to accelerate the effect. Vegas keyframes only provide linear interpolation between points (i.e., there is no speed up, other than the "fast" or "slow" settings available for each point, and they are amazingly confusing to use).
Former user wrote on 4/25/2006, 12:21 PM
Johnmeyer,

With a combination of the Fast Slow and smooth and using the smooth amounts you get a speed up and slow down on moves. I used it recently for a big slide show and you have a lot of control over the acceleration. This is in Version 4 but I assume later versions use the same math.

Dave T2

Tech Diver wrote on 4/25/2006, 12:32 PM
DaveT2, if I were speeding and then slowing down I could handle it with the built-in interpolation options as you suggest. However, if you are speeding up, then speeding up some more, and then even more (you get the picture) while always moving in the same direction, then you have the problem that I experience. Just try it yourself and you will see very quickly what I mean. I really don't think there is an easy solution. My current approach is to add many linear keyframes, but this is not easy because it takes a lot of tweaking to get it smooth enough to be barely noticeable.
Former user wrote on 4/25/2006, 12:40 PM
Okay, I think I see what you are trying to do.

As a test, Set a first KEYFRAME<SLOW<SMOOTHNESS ABOUT 33

Last Keyframe SHARP<SMOOTHNESS 100.

This does a constant acceleration.

Dave T2
Tech Diver wrote on 4/25/2006, 1:20 PM
Yes, that is definitely better. But unfortunately I need more control than just the beginning and end points. My specific application is moving a background starfield to match the fly-by of a spacecraft. If you are curious to see it, you can download an 18 sec WMV clip from my computer with FTP. It's size is 963KB rendered as 320x240 and 15fps to keep the size small:

ftp://honig.getmyip.com

Since my ISP does not want me run any servers, I will keep this open for only 1/2 hour (4:15 to 4:45 EST). Please download the file rather than play it directly to lessen the load on my machine. If the traffic gets too high I might have to shut it down sooner. Thanks.
Chienworks wrote on 4/25/2006, 2:20 PM
Sounds like a velocity envelope would be the best bet. Make a clip of the starfield moving at a constant speed, matching one of the slower speeds you'll need. Place this new clip on the timeline and add a velocity envelope. This will let you control the speed from moment to moment in a very smooth manner.
johnmeyer wrote on 4/25/2006, 3:14 PM
I'm working on a script to see if I can generate keyframes that will approximate acceleration ... standby ...

[Edit] I can't get it to work ... never mind.
Tech Diver wrote on 4/25/2006, 6:56 PM
Kelly, thanks for the suggestion about the velocity envelope. I'll give it a try and let you know how it turns out. Also, thank you John for trying a script. The problem is actually a tough one to solve without having the ability to control the displacement through a graph/envelope. With that being said, I will also try the transformations in the Wax plugin which does have Bezier interpolation and graphs, though I was hoping to do it all within Vegas. If I do use Wax, I might even map the star-field onto a large cylinder, position the viewpoint at its center, and use rotation instead of panning.
GGman wrote on 4/25/2006, 7:39 PM
Tech,

Add more keyframes between two keyframes to change things. For example, you have a 10 second event with two keyframes, start and end. It will slowly build up leaving key 1 and slow down to key 2 at the end over 5 seconds. Now add a linear key at 1 second and another at 9 seconds. Make key 1 a SLow and Key 3 a Fast, Keys 2 and 4 are Linear. It will now slowly speed up at the start but it will be at full speed at 1 second instead of 5 seconds. At key 3 it will gradually slow down to key 4, the end. Adjust the position to keys 2 and 3 to determine how slow and fast you want each end of the move to be. Sometimes it takes a combination of keyframes to achieve what we want since we do not have bezier keyframe controls. If you have areas in the middle of the event that need to slow down and speed up, add more combos like I mentioned.

GG
johnmeyer wrote on 4/27/2006, 1:25 PM
I did write a demonstration script that shows the potential of doing accelerated keyframing via scripting. I posted it here:

Keyframe acceleration script