Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Smooth camera pan – even out the jolts

  • Smooth camera pan – even out the jolts

    Posted by Justin Huss on May 12, 2009 at 5:44 pm

    Hello everyone,

    Ok it’s been 6 hours I’m on it, I gotta admit I can’t do it alone 😛 I shot an interesting shot panning vertically from the foot of a mountain to its top. I used a tripod and did my best to get the smoothest motion but it’s not perfect yet.

    So here I am in AE trying to even out the speed of my panning. My findings for now:

    – I used offset tracking to track two points and combined the paths I get (in a MASTER NULL layer).

    – I stabilized my footage on the x axis (when my MASTER NULL moves one pixel to the right or left, my footage moves 1 pixel in the opposite direction) to counterbalance unwanted lateral moves.

    – I stretched my footage (scaled to 102%) so that moving it (as explained in the previous sentence) does not reveal the void behind it.

    I spent 5 hours to do that, and in the end if I’d have made the right choices since the beginning it takes 5 minutes… ANYWAY!

    Now comes the best: I want a SMOOTH PANNING which equals to an EVEN SPEED. I have the movement curve in MASTER NULL and I have my algorithm planned.

    Upstream work: computing how much pixels high is the path (y axis only, it’s a vertical panning), divide by total amount of frames to get the amount of pixels per second. Let’s say a fixed point on the mountain moves 3 pixels down per frame.

    My algorithm:
    1. for my MASTER NULL layer, COMPUTE y_previousFrame – y_currentFrame = y_relativeValue.

    2. IF (y_relativeValue – 3) != 0 THEN i offset my footage on its y axis by the difference (y_relativeValue – 3).
    ELSE DO nothing.

    To sum up, when the camera moves too fast or too slow, I compensate by moving my footage layer on the y axis. Again, I scaled it to 102% so there’s few risk to see the background.

    MY PROBLEM: I need the y_previousFrame value for the previous y position of MASTER NULL, and I couldn’t find a way to get that using expressions. I searched for environment variables but it seems they don’t exist in AE.

    MY QUESTION: can you help me with expressions or do you have a plug-in/feature I didn’t find in AE that would have spared me losing a whole afternoon?

    Cheers 😛

    Elaine Shue replied 8 years, 7 months ago 8 Members · 13 Replies
  • 13 Replies
  • Justin Huss

    May 12, 2009 at 6:50 pm

    Thanks Dave that’s probably what I need to hear… or read. I started After Effects a few days ago, don’t really know where I can afford to save time yet… So I’m gonna try without all this then.

    The problem is I’m going to composite CGI with this shot, a coin flipping, and I’m gonna have to apply the *unwanted* movements to the coin, I just hope it will look nice 🙂

    Thanks for the frank answer 🙂

  • Kevin Camp

    May 12, 2009 at 7:24 pm

    not saying that reshooting wouldn’t be a better idea, but….

    you can get the value of a property at a specific time using the valueAtTime() function…

    this expression would return the value of ‘master null’ at the time one frame earlier than the current time:

    thisComp.layer(“MASTER NULL”).transform.position.valueAtTime(time-thisComp.frameDuration)

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Justin Huss

    May 12, 2009 at 7:55 pm

    Thanks a lot Kevin! I’m not saying Adobe’s documentation is not clear but… I find they should stick to the JavaDoc type of documentation 😛 Thanks for that, I’ll try it!

  • Justin Huss

    May 12, 2009 at 7:58 pm

    Dave I will try the cheapest way first and if I have time I’ll use the valueAtTime method just for the sake of comparing both methods!

    You’re both great, thanks a lot!

  • Chris Wright

    May 12, 2009 at 10:19 pm

    just a note, virtualdub’s deshaker is free and in 2 clicks you have perfect pans, tilts, rotations, zooms. It will do bicubic resampling and edge zoom compensations. Also supports widescreen and hdv.

  • Justin Huss

    May 13, 2009 at 7:29 am

    Thanks Chris,

    However my main concern is to smooth the camera movement which has to involve tracking and I doubt VDub’s Deshaker takes care of that. Plus I am too lazy to transfer my footage to my PC as I’m working on my Mac.

    I’ll give it a go soon though cause it is a pretty interesting feature! Thanks 🙂

  • Ian Berg

    July 7, 2009 at 5:01 am

    hey.. i know this is an older post.. but i just had this same problem last night working on a left to right pan shot… i spent hours searching through forums.. till a compositing friend finally helped me understand how to do it.

    If you take the footage and do a stabalize motion to a single or dual point (for rotation or scale) then after you have applied it the footage moves around those points. then go to the beggining of the pan add a keyframe on the position transform. moving the position so that the footage is in the center of the screen (stabilize motion only effects the anchor point not the position so changing this value will not cause problems with the stabilization) then go to the end of the footage and do the same creating a keyframe on the position transformation and center the footage on the screen. this will ideally create a even movement from left to right.. or in your case from top to bottom. you may have to scale the footage up to cover up the black.. but the less keyframes you have the more even it will be. hope this helps.. even if it doesnt help you maybe the next person who has this difficulty may use this.

    Cheers

    Ian

  • Dale Paquette

    October 24, 2009 at 1:59 pm

    I have the same problem on some footage I recently acquired. I have a problem with the suggestion of just keep shooting till you get it right. My footage is from the Colorado River deep inside the Grand Canyon where the time available for shooting while hiking is all but impossible to find let alone set up a tripod and keep shooting. Some of the kikes would in fact be deadly if I were forced to carry all the necessary gear up the primitive rock and boulder trails. A re-shoot would cost me >$4K and take 18 months due to river scheduling regulations. Sometimes it is simply necessary to shoot hand-held and do the best you can in post. If there is a way to handle this, I think the community would be better served with ideas and concepts for doing so. Thanks. Dale

  • Thomas Kiddle

    January 10, 2010 at 4:51 am

    just tryna do the same thing, Thought of a way that may work just not sure how to implement it.

    If you track a point it will move across, with this point you calculate the speed that it travels then some how speed up the footage depending on how slow the point is moving across the screen? does anyone think this would work?

  • Andy Bay

    February 2, 2010 at 11:13 pm

    Thomas Kiddle -I have been thinking about that too. The way I see it, it should be possible to somehow tie the time-remapping of the video to a tracked point in order to make the picture move at a constant speed. I just don’t have the math or coding skills to calculate how it should be done in practise. Does anyone else think this could be pulled off?

Page 1 of 2

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy