In this tutorial you learn how to stabilize a shaky shot with the Mocha tracker and the MochaImport script. After stabilization, you usually need to zoom in a bit to get rid of empty areas that show up at the borders of the image. Instead of this, we use a clever technique to fill the missing parts at the borders such that there is no need for zooming any more. The technique uses frames before and after the current frame to fill in parts of the image that are missing in the current frame. Sounds complicated but works very well and is done with a few clicks using MochaImport.
Things to learn in this After Effects tutorial:
- Learn how to track in Mocha (I use Mocha Pro, but it also works with any other variant)
- Learn how to stabilize a shot with the MochaImport script.
- Learn how to smooth the camera movement with a simple expression.
- Learn how to fill in missing parts at the borders of the stabilized footage by inserting appropriate material from the frames before and after the current point in time.
Contents
- Tracking the shot in Mocha (1:46-5:44)
- Stabilizing the shot (5:45:55-11:25)
- Fill in missing parts at the borders (11:26-21:01)
Expression for Smoothing the Camera Movement
smooth(width = 1, samples=5, t=time)The smoothness can be controlled by the value for "width". To get an even more smooth movement make this value larger, to make it less smooth make it smaller (e.g. "width=0.5"). "width=1" means that the values over the duration of one second are smoothed (i.e. averaged).
See also
- Ultra-Smooth Pans with Mocha and AE shows how to smooth the motion using iExpressions instead of normal expressions.
After Effects Project Download
tut-mocha-stabilize.zip (7,03 MB)


Comments
Here are some tutorials about MochaPro as a starting point:
www.imagineersystems.com/.../
Can you make tutorial about lens correction?
Thank you Mathias
Another option for extending the frame is to nest your composition, then use the Time>Echo effect twice. Once with the expression thisComp.frameDuration and another set to -thisComp.frameDuration on the Echo Time parameter. Set the Echo Operator to Composite in Back and adjust the number of echos, and you now have a more automatic method than duplicating your layer.
If you want to skip frames, you could add *2 to the expression to use every other frame, *3 for every third, etc…
I just tried it, but it has one drawback compared to shifting the layer: Assume, you apply the echo on the nested comp to composite the frame that is let's say 10 frames before the current one below the current frame. Then the frame from 10 frames before is placed there, where the camera was pointing 10 frames before and not where it is pointing at the current frame. In other words: The overlayed frames are not aligned correctly.
In short: with the echo effect you go back in time and camera positioning, whereas when shifting a duplicate of the layer (but not the NULL containing the camera movement), you only go back in time, but not with the camera position.
Burt
I used to do this manually (only with single planes as background extensions), this mocha+mochaimpo rt workflow really speeds things up!
My method used to be (ae only):
- Track single point in shaky footage
- apply this data to a null.
- parent another null to this null, and add a divider in the link expression. /2 equals to half the smoothness!
- drive the footage position with new null
Your way is much, much better! Thanks :)
Many thanks, your site ROCKS!
My first attempt (using your technique) showed a good stabilization in Mocha but got weird in AE from about frrame 130 to 160 during the zoom. But tracking backward solved that problem for me!
Those techniques really work.
Thank you!
Без тебя было не разобраться!
Можно этот видео урок скачать?
Thank you!
You have used a video which includes panning. What I would like to ask is that; is your method works well with the shot using tilts.
Best.
it works fine with any kind of motion. Only rolling shutter and motion blur are things you won't get rid of. And if you have moving subjects or foreground elements creating paralaxe effects, those might cause artefacts in the reconstructed border parts of the image.
if your actress is moving independent of the background, you will probably only be able to fill the background and have to do the paining on the actress by hand. Track the background and proceed as in the tutorial (skipping the stabilization part). You can also try to track the actress to fill in the part that is covered by the actress but for this is will probably be harder to get good results.
RSS feed for comments to this post