This After Effects tutorial is inspired by an HP commercial. You learn how to do corner pin tracking with Mocha. Actually, a simple corner pin can be done in MochaImport with just one click. But you will also learn about more advanced stuff like adding motion blur in After Effects that makes your corner pin more realistic.
Things to learn:
- Learn how to do a quick corner pin track in Mocha and how to improve the track.
- Learn how to create a corner pin with motion blur in one click, if you have Red Giant Warp.
- Learn how to create a corner pin with motion blur just with After Effects and no additional plugin even if your version of Mocha (e.g. the one included in CS4) does not support motion blur.
Expressions Used for the Motion Blur
for the blur direction:
var pt1=effect("CC Power Pin 2")("Bottom Right").valueAtTime(
time-thisComp.frameDuration/2);
var pt2=effect("CC Power Pin 2")("Bottom Right").valueAtTime(
time+thisComp.frameDuration/2);
deltaX = pt1[0] - pt2[0];
if (deltaX == 0) { deltaX = 1; }
deltaY = pt1[1] - pt2[1];
sign = (-deltaX / Math.abs(deltaX)) * 90;
radians_to_degrees(Math.atan(deltaY/deltaX)) + sign
for the blur length:
var vx=effect("CC Power Pin 2")("Bottom Right").velocity[0];
var vy=effect("CC Power Pin 2")("Bottom Right").velocity[0];
Math.sqrt(vx*vx+vy*vy)/50
After Effects Project Download
tut-corner-pin.zip (24,9 MB)
german version of footage (25,8 MB)


Comments
I thank you for also making the footage available to follow along with. Its nice to have more opportunities to refine my Mocha skills. Keep up the good work!
Probelm is now solved.
This was acually a bug in MochaImport that occurs when the file you tracked didn't start at the beginning of your AE composition.
The fixed version (MochaImport 3.02) is now available for download.
I've a question...is there a reason to use image sequences to track something? I mean, you think is better or it's not an importanr issue...(sorry for my english)
Thanks for sharing!! Have a nice day
I am just used to use image sequences everywhere as you don't need to rerender the entire sequence if you need to change something later. But any other file type supported by Mocha is fine. You can, for example, directly use the h264-files provided in the tutorial's download package.
This has been my favorite tutorial on Mocha I've done yet. It's very basic, in-depth, shows variations, and is very practical for future usage and tutorials.
One major question if you're still reviewing this tutorial thread...
In the tutorial, the image inside the frame has a small crack of background showing through even with the added motion blur. I would like to make my track window more seamless with the frame. is that due to amount of blur or something I should redo in terms of x-splicing the track.
Thanks for making an awesome tutorial
you can try to enlarge the mask in AE (if you use the RG warp technique) or the blue surface rectangle in Mocha to contain more of the actual picture frame.
Clear, easy, well done for every one.
Waiting for the next one (all of us know the time it takes
to provide such a quality tutorial, we will be patient).
Danke,
Fabien
I have already planned a few new tutorials. The next one will not be specifically about Mocha, but also related to it.
specially for the Motion tips that the use in the action movies
than you for this question. It is in deed a little tricky:
When you do a normal corner pin, you take an image and stretch it to fit exactly in the picture frame. For this you need one CC Power Pin Effect.
In our case we don't have the picture we want to corner pin available as a jpg or similar. We first have to extract it from the video clip. What picture do we want to corner pin? The picture of my face. Therefore, I need a second CC Power Pin to extract exactly this part of the entire scene from the clip. The 'unstretch' takes the part from the clip that is inside the picture frame and stretches it to full screen. And this is the perfect source we need for the first CC Power Pin. Is it more clear now?
i've followed exactly your steps but when i hit apply after effects crashes. Have you any idea what i'm doing wrong?
Depending on how fast your computer is and what function you use, it may take some time until it is finished. For long tracks or on slow machines it might be necessary to wait a few minutes until it is finished and reacts again. Does is work with short tracks (say 50 frames) ?
I do have a slight problem though. I don't have Red Giant Warp, so I'm using the steps without that. The first track worked out great. However, in the second track, after moving the four corners of the CC PowerPin to the insides of my frame, when I load the MochaImport file, the shot doesn't align within my frame. It tracks the frame ok as far as movement is concerned, but the picture doesn't align or fit in the frame. Any ideas what may have went wrong? I've checked the track in Mocha, and it appears ok... Perhaps I should just re-try...
I still really love the tutorials though, wish all tutorials were so well organized.
BTW i too see your job with the Graffiti girl, comes alive.
PRETTY GOOD!!
please help :)
and nice tutorial :)
when you load the tracking data, nothing happens, yet, except that the status light changes. In a second step you need to apply the data to the layer (as shown in the tut).
Cheers,
Mathias
the project file can be downloaded on this page. I think you can download the tutorial video on vimeo if you are a registered user there.
RSS feed for comments to this post