Mocha Pro Track doesn't make insert track properly

I just upgraded to Mocha Pro for AE on my Macbook Pro OS 10.13.6. I tracked a phone in Mocha Pro and created a screen matte. While in Mocha Pro my track looked perfect and I could insert a logo, grid or my imported Comp and it all tracked perfectly. Back in AE, I could not get the tracking data to work on the same Insert that played perfectly while in Mocha Pro. The first frame lined up in size and shape but immediately after that it starts floating around and not at all like the phone movement so transform adjustments won’t work. I tried corner pin with and without motion blur, I tried going back to Mocha Pro and exporting the tracking data then pasting it on the Insert track in AE, still gave the same results. What else can I do to trouble shoot, or get that tracking onto the insert clip so it works?

Hi @helenhand

Let’s try the usual culprits first and work from there:

Layer Dimensions
Is the insert in After Effects the same size and dimensions as the source footage/comp? This is usually the issue. After Effects applies corner pin effects based on the dimensions of the image, not the comp, so it can become disorted if the layer hasn’t been scaled.

To get around this:

  1. Scale your insert image to be the same size as the composition by using Layer > Transform > Fit to Comp
  2. Precomp the layer so the scaling remains intact
  3. Apply the mocha corner pin to the precomp

Alternatively, if you’ve already lined up the image in After Effects to match where you want it, you can change the Mocha surface to match:

  1. Precomp your lined-up image
  2. Go back into Mocha and on the frame you’ve set your insert position, click “Align Surface”, which is the small blue icon with the arrows projecting out to the edges of the button. This will make the surface the same size as the source footage dimensions
  3. Close and save mocha, and then apply the corner pin to the precomped layer you’ve lined up

Frame Rate or Frame offset
Sometimes the frame rate or frame offset can be misaligned, especially if you’ve cropped down the layer, edited the timing or trimmed the composition.

  • Does your frame offset in Mocha match the frame offset in After Effects?
  • Do you have any time stretch on the layer?
  • Are any effects applied to the layer before Mocha that may alter the frame length?

The insert comp was deliberately bigger than the main comp size. I changed it to match but still doesn’t work. The frame rate is 23.97 and is the same in Mocha, I would think. since the comp was made from an imported avid file. I did have a time stretch on the shot. My editor had a 200% speed change on the shot in the avid so I was trying to duplicate that. Even when I take that off the insert still isn’t right.

Ok, let’s try a simple test:

  1. Create a new solid
  2. Apply the corner pin to the solid.

Does the solid stick to the screen correctly?

I tried the Blue Solid and got the same results. The first frame match then drifted around. I discovered I had not remove the time stretch. I started over with the time stretch removed and this time tracked the phone with the perspective on. The result is worse, Here are screen grabs. Should I redo with no perspective on?

![AE with Blue Solid|690x388]

What does the surface tool look like for you in Mocha? Is it aligned where you need it or is it in the middle of the screen?

I’m not sure what you mean vy surface tool. In Mocha the insert aligns perfectly with the screen insert matte and tracks perfectly with it.

I haven’t solve my problem. I exported the insert layer and Matte layer separately and comped them in my avid editing. Mocha Pro is crashing every time I try and use it now, so maybe it is not compatible with my computer. Should I try to uninstall and then re-install Mocha Pro?

The surface tool is the blue corner pin inside of Mocha. Your shot looks like the surface tool is not matching to the screen. A blue solid of the comp size should work if your track is correct and properly aligned and the insert is the same size as the comp. Turn your surface tool on and check inside of Mocha that it is 100% moving correctly.

If you just took the time stretch off and didn’t retrack, you will absolutely need to re-track first however.

This really looks like the track is incorrect.

I did retrack, after taking the time stretch off. Mocha Pro caused AE to crash too often so I retracked in Mocha AE. Sorry I forgot what the surface tool was. Yes I do have the surface tool on and I also inserted a Grid32x32 into the screen matte. It tracks pretty well I think. This is what it looks like now. Is my track just not good enough?

Your track is accurate, you application of the track is not. Are there keyframes on the AE timeline for the corner pin?

There are no keyframes on the timeline for corner pin. I have set the Create Track Data to export to the Insert layer source. The export option is Corner Pin (Support Motion Blur). I clicked apply export. What am I doing wrong?

OK, if the data isn’t saved it might not be applying, or if your layer is trimmed to the wrong section the same might be true.

Let’s review the workflow to use our Mocha tracking data:We select the Chosen Layers…to pick which Mocha layer we want to convert to AE. To choose a layer to create tracking data from, click the ‘Create Track Data’ button in the Tracking Data section of the plugin.Then choose either the name or the cog of the layer you want to read tracking data from in the dialog that appears. You can only choose one layer at a time. You can then see the output of its surface back in the After Effects interface. Each point in the Tracking Data section is a point from the layer surface that automatically updates when you modify it inside Mocha.

Create Tracking data. Once you click ‘OK’, the plugin will generate keyframes to populate the tracking parameters in the plugin. You can then use this data to copy to other layers, or link via expressions, without needing to export from the Mocha GUI. You can use any of these keyframes once they’re created, so you can copy/paste the data or you can use expressions to apply them to other layers in your composition. In this instance, I’d like to apply the corner pin to a screen.

Apply tracking data to a layer or a Null, use the dropdown menu to select an export option at the bottom of the Tracking Data section:- You can either use a Corner Pin to apply onto a any layer, (which is a standard corner pin effect), a Corner Pin that Supports Motion Blur (A corner pin distortion with separate scale, rotation and position.), or a Transform: (Scale, position and rotation like you would use to paste on a null). Clicking ‘Apply Export’ then applies the tracking data to the specified layer. Anytime you are using a corner pin, your target layer must be the same size and the same frame rate and aspect ratio, as the comp and layer you are tracking in Mocha AE or your data will be distorted based on the difference. I am using the Mocha AE interface to a apply corner pin that supports motion blur to my screen layer. So I select my export here, corner pin, and I select my target layer, in this case the layer named screen, and I hit “apply tracking data.” Now my corner pin is applied right to my screen.

So in short: Click create track data, select your desired layer, click OK, use the dropdown menu to select and export and the target layer, and click apply export.

If you’re doing that and it still isn’t working, reopen Mocha and see if the tracking data is still there. If it is not, the plugin has not been saved. The plugin must be saved AND closed in order to apply the data.

If that STILL isn’t working, something about your AE file setup is likely off or you’re using an older version of Mocha and copying and pasting the plugin and data is getting pasted in off the timeline and that’s a bug. Make sure you are on the latest version of Mocha Pro and try again. Troubleshoot your layers and make sure they are trimmed properly to your work area as well.

Try that and let me know,

Hi Mary
thanks so much for your help. I started over and redid the track and matte. Still got the same results. The corner pin did not copy into the AE Insert timeline. The Corner Pin effect was added but not the keyframes. nor did they export to a Null layer or to a plain solid.

My AE account said my version of After Effects was current but I have been crashing a lot. I uninstalled AE and reinstalled it. The Corner Pin key frames now export to the Insert timeline and it tracks perfectly.

thanks so much

Oh, I’m glad that fixed it but I do wonder what the issue was. Must have been a foundational problem with the install I suppose.

I have Mocha Pro installed on both my Avid editing system and in AE. Could the two plugins be conflicting? As soon as I installed Mocha Pro For AE, I started crashing a lot. My After Effects may have gotten a corruption. I’m not using Mocha Pro for AE or Avid any more because of the crashes. Should I uninstall them? If so how?

No, I have just a ton of versions of Mocha on my machine and it is fine. Crashes are probably coming from GPU tracking, so turn that off. Also make sure you save and close Mocha before you touch AE or that can cause AE to decide it needs to crash.

There seems to be a bug on standalone Mocha Pro 2021 v8.0.1 when you export either corner pin or transform track data and paste it to AE. Mocha Pro for some reason exports a duplicated frame with the same value as the previous frame which offsets the track about 1/4 before it ends or 3/4 after it starts. For 1/4 paste as it is - For 3/4 move layer with pasted data +1 frame off in timeline. Check copied track values from Mocha Pro on a text editor and look for the duplicate values which occur sequentially somewhere around 3/4 of the length.
I ll post more details soon on a new thread. There s a workaround until it s fixed.

Interesting, I haven’t run into that. Do you have any time remapping on the shot?

No it’s just a normal rendered clip from Braw to Quicktime Animation. I have tried it with two different videos and both track exports gave me a duplicate - random value. For example for a video that is 196 frames, I found the duplicate value on frame 115 + 116.

However today I tried to replicate the problem with one of the two videos. I didn’t find any duplicate value but pasting the track in after effects gave me the same jittery result either at the beginning or at the end of the clip. This time, I found the frame number where the track starts to jitter, went back to the text editor, removed that specific frame number + value from all the corner pins, position, rotation & scale, copied and pasted it again in after effects. There was one keyframe missing so I selected all the keyframes which were after the gap and moved all of them to the left. There was no gap and track looked perfect. I also had to offset the layer with the pasted track +1 frame so that it syncs perfectly.

I am uploading a screen recording at the moment to show you exactly the problem and the workaround.
It looks as if there s an extra random frame value generated throughout the track export that causes the track result when pasted in after effects to be half accurate. Either on the beginning or at the end, depending on your frame offset. And the only solution I ve found to work is just to find the exact frame where the jitter begins -> remove it wherever it s included using the text editor and then drag all the rest keyframes inside After Effects to close that gap.