Newb trying motion tracking a patch of color

Hey all, I am new to Mocha and I did a stop motion project with some figurines with a green screen in the background.
The problem is that a bit of color on one of the figurines matches the greenscreen key color, so his chest suddenly becomes transparent.
At first I thought the only approach was to animate a garbage mask, but the Mocha for AE was rec’d to me.
Only issue is that I’m trying to figure it out:

  1. I know I have to make a duplicate layer in order to create the spline, but it’s all one composition right now
  2. The camera and the figurine are rotating counter to each other…this means the patch of key color I DON’T want keyed changes size. Is this a problem when creating a tracking motion for the patch of color?
    3)when I make the spline over the duplicate layer, is there any particular way I tell the program this is some form of hold-out matte?
    Thanks, I appreciate your help and understanding! :slight_smile:

—Quote (Originally by martinb)—
It doesn’t have to be flat, it just has to THINK it’s flat. :slight_smile: You can fool the tracker into planar regions pretty easily.
Actually, why not just send me the clip and i’ll take a look:
martinb[at]imagineersystems.com
—End Quote—
Sent it to you as an h264!
Please keep in mind, it’s very rough footage, I’m also trying to figure out how to smooth the animation a bit. I used the smooth slider in AE, and I’m next going to try to stabilize the footage as much as possible using Mocha.

—Quote (Originally by martinb)—
Try updating your graphics drivers. A black screen usually indicates a problem with openGL.
If that doesn’t work, try converting the h264 to QuickTime Animation codec or an image sequence like jpg, png or TIF.
—End Quote—
I just updated my computer to nVidia’s latest drivers, and I am still encountering this problem. Are you sure I’m importing it correctly? the resolution is 1080p and when I import, it labels the file “HD”
As far as converting the h264, I’m not sure how to go about doing that. There don’t appear to be such options in AE.
The closest codec I can use in AE seems to be as Photoshop or a TIFF Sequence with Alpha, but neither of those look correct to me. Is the conversion a process through quick time?

Ah! Ok, that makes a ton of sense, thanks!
One problem I’m having right now is that when I imported a piece of footage (all one camera shot) that had been compressed with the h246 codec, all the settings looked correct, but when I clicked the ok button, the screen is completely black. Scrubbing the timeline does not reveal the footage I imported.

hey Martin, thanks for the great help!
You pretty much nailed what I was getting at when I mentioned “rotation.”
—Quote—
draw your spline around the area you want to track. You can then apply the tracked spline mask to a new layer inside After Effects by exporting it to the clipboard and pasting in AE.
—End Quote—
So before I export the original layer to Mocha,should I create a pen-tool based “mask” around the color patch on a duplicate layer, then export the original, non-keyed layer to Mocha, applying the spline, and then copying-paste the spline data back into the Pen-tool’d layer (where the mask via pen was applied)?

—Quote (Originally by martinb)—
Which version are you using?
—End Quote—
AE CS5 & Mocha CS5

It does run in quicktime, but not very smoothly. What sort of compression would you recommend for importing a file into mocha?

—Quote (Originally by martinb)—
Try Animation, Pro Res or image sequences.
What system? Windows or OSX? What version of those? Vista, Win 7, Snow Leopard, Lion?
—End Quote—
I don’t understand. Compress as Animation, pro res, or image sequences? Or were you referring to something else?
My system specs:
I’m running on an AMD Quad Core from 2009 (2.6GHz 1MB L3 cache) , Windows 7, 4 GB DDR3, nVidia GTX 260

—Quote (Originally by martinb)—
In AE you can either render it as a proxy or just drag it into a comp and render the movie as a different type. If you want to do it via Quicktime you’ll need QuickTime Pro for windows.

You should have a lot more option for rendering sequences than just tif or PSD though. AE supports export of a lot of different types. Check the output module in the render queue and click on lossless… you should be able to get more options there.
—End Quote—
saved as a JPEG sequence…and it actually loads into Mocha.
Now I’m trying to figure out how to setup the patch. It seems that certain tools are greyed out until I create a shape with the basic spline tool.

My version is 2.2.0 build 2626 if that helps.
Not sure if it’d be relevant. I updated my graphics drivers, I even rendered to read in OpenGL in AE and I’m STILL getting this black screen problem.

—Quote (Originally by martinb)—
Very odd.
Are you always running AE and mocha at the same time? Have you tried quitting both and just opening mocha? There could very well be an open GL conflict with the 2 apps.
—End Quote—
No, I closed one, opened the other. My computer has been slower than usual lately, but thanks to your instruction, I successfully am seeing my project, after rendering it as a JPEG Sequence in AE.

hey Martin, just a minor update.
I am focusing on the last 3 minutes of the tutorial, I’m actually just tracking the body patch forward frame by frame, and so far, the patch is “sticking” just fine. I’ve adjusted the patch where I need to, and I’ve gotten pretty far just with tracking forward frame by frame and adjusting as I need to.
I have that luxury as you say because it’s a short clip, and this is thankfully, the hardest clip I have to deal with.

—Quote (Originally by martinb)—
It doesn’t have to be flat, it just has to THINK it’s flat. :slight_smile: You can fool the tracker into planar regions pretty easily.
Actually, why not just send me the clip and i’ll take a look:
martinb[at]imagineersystems.com
—End Quote—
shall I send you the h264 you can convert to JPEG Sequence or you want to be sent 73 frames?

First of all Martin, thanks a ton for the help. This is all incredibly informative and helpful for me, especially since I’m in the awkward position of never having done this before.
—Quote (Originally by martinb)—
Ok, looking over the footage I can see a few problems.
First, the mp4. This one appears to be corrupted in some way. It has a few frames at the beginning that are blank, which may be throwing things off. If I convert it to JPG it actually has 2 white frames at the beginning. Very odd. I do get the same black frames on my mac, so at least we’re on the same page!
—End Quote—
I converted the h264 into a jpeg sequence because loading mp4s into mocha for me produces a black screen. When I clicked on the first jpeg of this sequence, it was a regular frame, no black or whiteness.
—Quote—
Secondly the actual content will be very hard to track, but not impossible if you’re just doing roto. You are going to lose the track where the other man passes in front because the tracker has to keep visual contact with the area you are tracking.
—End Quote—

—Quote—
If you track a mask around the item in his right hand you can stop it from interfering with the patch when you track that. I would track the clearest frames first then when the other man passes in front, stop the track and move forward. There will be some manual roto here, because of the amount that is hidden.
—End Quote—
This seems straight forward enough.
—Quote—
The hardest part, sadly, is in fact the stop motion. Stop motion or time-lapse can break tracking because it’s not a smooth transition from one frame to the next. Luckily you have a nice planar surface for the torso, but you also have reflections. Mocha should ignore most of them but if you have bright changes in other shots it will be harder.[/quote[
I can’t use the green screen as a planar surface? I’m going to key the original layer, but the track will apply to the duplicate layer which is serving as a mask so it shouldn’t be a problem, right?
Since you’re only doing roto for a basic patch however it shouldn’t take too long.
—End Quote—

—Quote (Originally by martinb)—
That looks like the older version of mocha AE. Are you running CS5.5? Check to make sure you don’t have an older version installed.
You only see keyframes for parameter changes and points. If you select the points of the spline you will see the keys of your changes.
—End Quote—
I am running CS5. not 5.5.
Also, what do you think about the tracking buttons being greyed out?

hey martin, thank you for going above and beyond what I asked for in terms of help. Your video is incredibly helpful, although I am still confused about several things.
Right now, I’m still working my way through X-splining the sword matte, and while I adjust it through tracking, I may have “over-tracked” the sword. While adjusting the splines, I notice there don’t appear to be any key frames (green points) on the timeline, even though I have the layer selected.
My toolset looks slightly different than yours, although all the tools are in the same position, it’s a little off-throwing.
Image: http://i207.photobucket.com/albums/bb289/teh_Mac/mochaopic.png
thats what it looks like so far. Is there anyway to get the toolset to look like your version?

Martin, here’s a pic of what I have done so far with the body-patch
As you can see, I keyframed almost every frame in the final stretch
Image: http://i207.photobucket.com/albums/bb289/teh_Mac/mochapic2.png
I appreciate your thoughts.
Also, I’m assuming because this is a roto, and the exact coordinates will match up with the original footage, I needn’t worry about the matte overlapping into the shield, and creating an awkward layer, right?

It doesn’t have to be flat, it just has to THINK it’s flat. :slight_smile: You can fool the tracker into planr regions pretty easily.
Actually, why not just send me the clip and i’ll take a look:
martinb[at]imagineersystems.com

No. You shouldn’t need to do anything to the original clip. Again, I recommend watching the tutorials as it will become clear. The whole idea is to replace the mask/tracking work you would normally do in AE.
Here’s the basics of mocha workflow:

  1. Import your footage into mocha. We recommend single shots rather than a multi-edit clip
  2. Draw a spline around the object you want to track. It helps if the object is planar, but doesn’t have to be. In your case, you would draw a spline around the area you want to patch.
  3. Set your parameters. If there is perspective shift, turn on perspective. If you just need to track scale and position, turn off shear.
  4. Track the object. The spline should move as you get the track. Turn on the surface or grid to see the actual tracking.
  5. Adjust your spline if necessary.
  6. Click Export shape data and copy to clipboard.
  7. Go to After Effects, duplicate the layer you wish to effect and paste. If you are in CS5 or higher you can choose to paste the effect or AE masks.

Mocha works on a shot-by-shot basis, so you just need to import the original non-keyed footage and draw your spline around the area you want to track. You can then apply the tracked spline mask to a new layer inside After Effects by exporting it to the clipboard and pasting in AE.
Mocha tracks scale, rotation and trasform data as well as any skew or perspective shift. I’d have to see the footage to get a better understanding of what you mean by the motion.
You don’t need to tell mocha it’s the hold-out. You can just export the matte into AE and use it there. Mocha is intended to be the tracking and roto part, not the final composite.
I recommend you take a look at the Learn Mocha videos on our website to get a better idea of how to use the software:
http://www.imagineersystems.com/learn-mocha