ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Mocha and inverse motion stabilization - scale?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
bart stevensMocha and inverse motion stabilization - scale?
by on Oct 2, 2012 at 7:22:50 pm

I'm new with Mocha and had a question about using it with inverse motion tracking.
I'm working with some footage where I want to track effects on a face.
I'm comfortable working from Andrew Kramer's "Demon Face Warp" tutorial, which utilizes AE tracking data to do inverse motion stabilization, but I'm very impressed with the Mocha tools and want to use the program for this challenge.
I've been able to export the track from Mocha and stabilize it using these expressions:
rotation:
rotation *-1
scale:
x = 10000/scale[0]; y = 10000/scale[1]; [ x, y ];

It's almost there, but the scale is throwing me off.
When using the AE tracker in Andrew Kramer's tutorial, I don't have scale data, where with the Mocha track I do. I know I can omit this data from the export to AE, or delete it, but is there a way I can use it? I'm assuming that will give me a more accurate track.
Thanks,
Bart


Return to posts index

Roland R. KahlenbergRe: Mocha and inverse motion stabilization - scale?
by on Oct 3, 2012 at 2:19:53 am

The scale Expression you have is correct. It's hard to tell why it's not working for you without taking a look at the footage and at least a snapshot your tracking splines in mocha. If can post these up here then we'll be closer to sorting out your issue.

Cheers
RoRK

Intensive AE & Mocha Training in Singapore and Malaysia
Adobe ACE/ACI (version 7) & Imagineer Systems Inc Approved Mocha Trainer


Return to posts index

bart stevensRe: Mocha and inverse motion stabilization - scale?
by on Oct 3, 2012 at 4:25:25 am

Maybe I didn't communicate clearly.
The expression is working correctly from Mocha, it's just the second step in using the information in After Effects.
The footage scales up and down to "stabilize", but I can't get that to reverse.
The Andrew Kramer tutorial addresses the position ( swapping anchor point data with positional), and rotation (with the *-1 expression).
But his method using the After Effects tracker doesn't create scale data, and I wondering if there is way to use it? Or if that will help with the accuracy of the track.
Hopefully that makes sense.
Thanks


Return to posts index


Roland R. KahlenbergRe: Mocha and inverse motion stabilization - scale?
by on Oct 3, 2012 at 4:22:19 pm

Hi Bart, just to be clear, mochaAE/Pro do not provide stabilization results off the bat; unlike how AE's point tracker does.

Once you paste mocha's tracking data, you'll need to invert the scale and rotation data and remove all keyframes for Position to establish stabilization. The Expressions you have for Rotation and Scale should work.

To invert the stabilization
1) precomp the original comp
2) increase size of the original comp to prevent clipping
3) then create Expression links FROM the nested comp's transform properties TO the original comp's transform properties like so -

a) link anchor point to position
b) link position to anchor point
c) link scale to scale and use the same scale Expression
d) link rotation to rotation and use the same scale Expression

4) apply your distortion effect BUT do not Collapse Transformations.

BTW, I've seen 'faulty' inverse stabilization tutorials where there is no need for inverse stabilization. What a few folks are not cognizant of is that Andrew required the inverse stabilization because the liquify effect that he used does not have position properties. IF you are using a distortion tool that does have x/y properties then there is no need to stabilize, apply effect and then invert the stabilization. Since the distortion tool has x/y values, just link those values to the tracking data.

HTH
RoRK

Intensive AE & Mocha Training in Singapore and Malaysia
Adobe ACE/ACI (version 7) & Imagineer Systems Inc Approved Mocha Trainer


Return to posts index

bart stevensRe: Mocha and inverse motion stabilization - scale?
by on Oct 3, 2012 at 4:54:32 pm

Ah ha, thank you very much!
Using the same scale expression in the pre-comp was the part I missed.
Sometimes the obvious can stare right at me, and I still don't see it.
Thanks for the clarification of Andrews tutorial too. It's helpful to understand the principals of the technique.
Cheers,
Bart


Return to posts index

Roland R. KahlenbergRe: Mocha and inverse motion stabilization - scale?
by on Oct 3, 2012 at 5:56:59 pm

I'm glad things have worked out for you Bart.

Cheers & Happy Rendering
RoRK

Intensive AE & Mocha Training in Singapore and Malaysia
Adobe ACE/ACI (version 7) & Imagineer Systems Inc Approved Mocha Trainer


Return to posts index


bart stevensRe: Mocha and inverse motion stabilization - scale?
by on Oct 4, 2012 at 8:24:01 pm

I was able to get the track nailed down, but still couldn't get the scale working where I could use it.
My track would stick (using the liquify filter, and still image), but with the scale data, the entire frame was scaling up and down to stabilize.
I'm not sure if it was reversed or not. The rapid scaling of the whole frame would lead me to suspect no, but the track was "sticking". So not sure..
If I deleted the scale info, and still linked it with expression, the track sticks and the shot looks "normal" (without rapid scaling up and down).
Seeing that the AE tracker doesn't use scale data, I'm not sure if I'm getting much out of the information anyway.
Working good enough right now, but the question is still there.


Return to posts index

Roland R. KahlenbergRe: Mocha and inverse motion stabilization - scale?
by on Oct 5, 2012 at 1:51:10 am

[bart stevens] "Seeing that the AE tracker doesn't use scale data, I'm not sure if I'm getting much out of the information anyway."

AE's point tracker does track Scale if the option is selected.

I suggest that you either send me stripped down version of your AEP -no footage files necessary or post screen captures of the Timelines with the Expressions scripts visible.

I've just now thought that something else is amiss which is related to the workflow, that may be misleading. In the 'first' comp, you would do the stabilization. Then precomp and increase the size of the precomp to prevent cropping. In the second comp, before you invert the stabilization, you should first apply the liquify effect. This ensures that the footage is in stabilized mode and is intuitive.

Once you're done with the liquify effect, you go ahead and apply the inverse stabilization (which re-introduces the original movement) routine to complete the entire exercise. I have a feeling that you proceeded with the inverse stabilization prior to applying the liquify effect. This also works due to AE's Render Pipeline but it may be less intuitive to less experienced users.

The following is what happens when you preview or render the final comp - almost like a play-by-play ;-)
1) The Render Engine sees a nested comp. It does nothing here but instead heads down into the nested comp to render the layers in that comp. So, the Render Engine goes through its Render Pipeline - Masks, Effects, Transformations for all the layers there. When completed, the end-result is that we have a stabilized footage - after Transformations are calculated.

2) The Render Engine then goes back up to the 'final comp' and goes through its Render Pipeline process again - Mask, Effects, Transforms. Assuming there are no masks here, Effects are calculated first, the Liquify effect - which is applied to the stabilized footage. Then Transformations are calculated, which in our case, is where the inverse stabilization happens or where we reintroduce the movement inherent in the original footage. Sense make?

So, things may look less intuitive at the end of the exercise than they would if you held back on applying the inverse stabilization and concentrated first on applying the liquify effect.

I wrote a review on Pete O'Connell's COW DVD Training (Motion Tracking and Stabilization in Adobe After Effects) and authored a tutorial on Reverse/Inverse Stabilization. The training covers tracking in AE and mocha. You can find more info here.

HTH
RoRK

Intensive AE & Mocha Training in Singapore and Malaysia
Adobe ACE/ACI (version 7) & Imagineer Systems Inc Approved Mocha Trainer


Return to posts index

bart stevensRe: Mocha and inverse motion stabilization - scale?
by on Oct 5, 2012 at 3:33:49 pm

Roland,
Thanks for the input. Yes, I was doing my stabilization then applying the liquify effect. I understand the render order, but it didn't seem to effect the track. Even with the scale issues, it looked like the track was holding. I've attached a stripped down version, if you get a chance take a look.
This is a side project, that I'm doing in my spare time, son no sense of urgency.
Thanks again for sharing your knowledge.
Cheers,
Bart


Return to posts index


Ross ShainRe: Mocha and inverse motion stabilization - scale?
by on Oct 3, 2012 at 6:04:03 pm

Bart,
You may want to check out mochaImport+ which is a script that assists your mocha data inside of AE. This allows you to easily use the data to stabilize then unstabilize a pre-comp.

Also lots of great tutorials from the developer, Mathias Mohl:

http://www.imagineersystems.com/products/mochaImport

best,
Ross

Ross Shain
Imagineer Systems
http://www.imagineersystems.com


Return to posts index

Roland R. KahlenbergRe: Mocha and inverse motion stabilization - scale?
by on Oct 3, 2012 at 7:49:51 pm

Hi Ross, me thinks mochaImport+ may not work for this effect. I do not have the latest mochaImport but the version I have, V 3.0.2, requires that the nested comp have its Collapse Transformation (CT) enabled. This prevents the Liquify effect from sticking to a tracked point as CT forces transformations, across both comps, to be calculated at one go. Hence, the initial stabilzation (in the precomp) is immediately offset by the inverse stabilization (in the 'final comp', before effects are applied.

Can you confirm that the latest build does inverse stabilization without imposing CT on the main comp?

Cheers
RoRK

Intensive AE & Mocha Training in Singapore and Malaysia
Adobe ACE/ACI (version 7) & Imagineer Systems Inc Approved Mocha Trainer


Return to posts index

Ross ShainRe: Mocha and inverse motion stabilization - scale?
by on Oct 4, 2012 at 4:41:07 pm

Hey Roland,
I can't confirm this right now... sorry. Will take a look in the next few days.

Another workflow could be to align the surface, then use the CP export out of mocha and choose "invert" before exporting - but there are some scenarios where this can be buggy.

Best,
Ross

Ross Shain
Imagineer Systems
http://www.imagineersystems.com


Return to posts index


Roland R. KahlenbergRe: Mocha and inverse motion stabilization - scale?
by on Oct 6, 2012 at 2:48:43 pm

Heya Ross, I emailed Mathias yesterday, I think, and he's tracking, er I mean, travelling at the moment. ;-)

He says he'll reply, here, early next week.

Cheers
RoRK

Intensive AE & Mocha Training in Singapore and Malaysia
Adobe ACE/ACI (version 7) & Imagineer Systems Inc Approved Mocha Trainer


Return to posts index

Mathias MöhlRe: Mocha and inverse motion stabilization - scale?
by on Oct 8, 2012 at 10:03:33 am

Thank you Roland and Ross, for pointing me to this discussion.

MochaImport+ is the right tool for this task. The precomps created by it use collapse transformations by default. However, a liquify effect inside the precomp still works nicely.

I just did a few tests and in CS6 it looks like it breaks if you use an adjustment layer inside the precomp. As this works fine in CS5.5, it looks like a bug to me. But even if you need an adjustment layer in your precomp, you can simply deactivate collapse transformations to make it work again.

The workflow of MochaImport's stabilized precomps is explained in the After Effects tutorial: Graffiti becomes Alive.


Return to posts index

Mathias MöhlRe: Mocha and inverse motion stabilization - scale?
by on Oct 8, 2012 at 11:15:09 am

I did a few more experiments.

The issue I found with CS6, seems to be something very specific to my particular project. In general applying effects to adjustment layers inside a precomp works fine. In my case, a particular combination of masks, the CC power pin effect and the Cartoon effect caused a problem on CS6.

It seems to be a special case. If you have any problems, I recommend to turn off collapse transformation or tell MochaImport+ to use the corner pin effect instead of the CC power pin (each of these options solved the problem for me immediately).

If you are interested in the details, here is the bug report I submitted to Adobe:

******BUG******
Collapse Transformation with mask, CC power pin, and adjustment layer in a precomp behaves in CS6 different than in CS5.5

Steps to reproduce:

1) take some footage and precomp it.
2) inside the precomp add an adjustment layer on top of the other layer and add the cartoon effect to it.
3) on the adjustment layer insider the precomp, add a cartoon effect (with its default settings).
4) apply a rectangular mask to the adjustment layer in the precomp. The mask shoud be located in the middle of the comp and cover roughly a quarter of it.
5) Copy the same mask on the footage layer inside the precomp (below the adjustment layer).
5) go back to the main comp and apply a CC power pin (with its default settings) to the precomp layer.

6) In the main comp, toggle the collapse transformations switch of the precomp layer on and off

expected behavior: There should be no difference between collapse transformations on and off (this is what I observe in CS5.5).

behavior: With collapse transformation on, the masked area is zoomed to cover the entire comp


This does not look like a minimal example, but as soon as I make it more minimal, the problem disappears.

The problem disappears, for example, when I do one of the following things:
- If I skip the mask on the adjustment layer (and only have a mask on the footage layer)
- If I use a corner pin instead of a CC power pin effect
- If I use a box blur instead of a cartoon effect or even if I put a box blur on top of the cartoon effect

Best
Mathias


Return to posts index


Roland R. KahlenbergRe: Mocha and inverse motion stabilization - scale?
by on Oct 8, 2012 at 12:08:53 pm

Awesome stuff Mathias. BTW, I think your issue with CC Power Pin with CS6 is related to this thread, where a temporary solution is possible. In the same thread, Todd, from Adobe has already escalated the issue with the AE Team and Cycore. Well ... more info on the link above.

Cheers
RoRK

Intensive AE & Mocha Training in Singapore and Malaysia
Adobe ACE/ACI (version 7) & Imagineer Systems Inc Approved Mocha Trainer


Return to posts index

Mathias MöhlRe: Mocha and inverse motion stabilization - scale?
by on Oct 8, 2012 at 12:15:52 pm

Hi Roland,

yes, it sounds like this could be related. I have no 3d layers in my project, but maybe collapse transformations and 3d layers cause the same problem.

Best,
Mathias


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]