7 Replies Latest reply on Feb 23, 2011 6:58 AM by Molgaard

    Motion tracking issues

    Molgaard Level 1

      I am doing a rather difficult (for a beginner) sky replacement on a panning shot.

       

      My first issue regards rotation. I've selected position and rotation for my tracking points, but after applying them to my sky layer, it becomes flipped upside down (rotated 190 degrees) and also out of position. Correcting the position is as easy as selecting all the position keyframes and dragging it to the correct starting point, but for rotation this doesn't work (it sets everything to one value). I want the first keyframe to be 0 degrees and for it to follow on from there with the tracking.

       

      Secondly, because the camera pans quite far, I need to change the tracking points midway through as there are no two points I can use that are in the entire shot. Similar to the first problem, I find that when I do this it resets the position of the sky layer, sending it out of place and upside-down. I guess what I'm looking for is a way to apply the motion tracking to the sky layer without losing its initial position or rotation (or any other value for that matter).

       

      Thanks!

        • 1. Re: Motion tracking issues
          Rick Gerard Adobe Community Professional & MVP

          If you have CS5 then I'd suggest Mocha for the tracking. It works amazingly well for long pans if you link the tracking data to none. Take a look at the last half of this tutorial and you'll see how to easily setup a track for a sky replacement. It's the part with the evening skyline pan.

           

          The next thing you'll face is creating a matte to cut out the sky. In many cases you can use a procedural matte technique to make a hole in your original footage to receive the new sky. If you post a still frame I'll gladly give you suggestions for creating the matte.

          1 person found this helpful
          • 2. Re: Motion tracking issues
            Molgaard Level 1

            Thanks a lot, I do have mocha but have never used it as I'm still in the early learning stage of AE. I'll watch through a couple mocha tutorials though and see where that gets me.

             

            Regarding the matte, I was intending not to use one as there is so much foliage detail it seemed impossible to key the sky out effectively. Instead I was just going to multiply the sky layer and apply a gradient. I've attached screenshots showing the start and end of the shot, before and after I've done my best on it. If you know a better way I can do it, I'd be very grateful.

             

            Cheers.

             

             

            Source beginning:

            demoA.jpg

            Source end:

            demoB.jpg

            With sky layer:

            demo1.jpg

            demo2.jpg

            • 3. Re: Motion tracking issues
              Rick Gerard Adobe Community Professional & MVP

              The Mocha tracking technique for tracking long pans will work perfectly for you. You can also use a mask to hold back the ground from the horizon down. and you could add a tracker to the actor for use in color correction.

               

              You can pull a much better matte from the trees using a couple of copies of your footage in a Matte pre-comp. To the top one apply Channel mixer and curves, then then use that higher contrast version of your footage as a matte source to clean up the matte. Once cleaned up you can use your multiply trick to complete the composite.

               

              Let me know if this helps.

              • 4. Re: Motion tracking issues
                Molgaard Level 1

                Alright, so I've finished watching through all the Mocha tutorials on that website and I think I'm getting the hang of it. One thing it doesn't explain though is how to then use that data in AE. I've done my motion tracking in Mocha and the panning technique seems to have worked quite nicely. I made some shapes in the sky to test it. But then when I try to export the data to AE (copy to clipboard, then paste onto the sky layer in AE is how I assume it's done), it seems to have totally misunderstood me. The sky stays put until about halfway through, then starts wildly rotating and shrinking. What have I done wrong?

                Thanks so much for your help!

                • 5. Re: Motion tracking issues
                  Rick Gerard Adobe Community Professional & MVP

                  First step is to set up the unlinked tracker. Sounds like you've done that. Second step is to link another spline to the tracker. I'd just lay one over the trees.

                   

                  That spline should track perfectly when linked to the first layer. If the spline moves around you'll have to adjust the track. The spline should always be on the screen. If it goes off the screen then you'll need to set an out point for that spline layer and add another one with the in-poiint matching the out point of the second layer.

                   

                  Now go to the first frame of your Mocha project, select the second spline and copy transform data to the clipboard. It's the bottom option on the pull down.

                   

                  Now back in your composition, set the CTI to the first frame. Add a null to the timeline, and paste the track data to the null. Press U to reveal the keyframes and turn off the anchor point stopwatch to remove all anchor point keyframes.

                   

                  Now parent the Sky layer to the null and it should track perfectly. If you need two linked splines in mocha then go to the in point of the second spline, note the frame number, copy the transform data of that spline, go back to AE and set the CTI to the same frame number as the second spline layer, add a new null, and paste the data to that null. Do the same thing with the Anchor Point, then make first null the parent of the second null and parent the sky layer to the first null but don't make the change until you've returned to the starting frame.

                   

                  I hope this makes sense. It's really very easy once you have a perfect track in Mocha.

                  1 person found this helpful
                  • 6. Re: Motion tracking issues
                    Mathias Möhl Level 2

                    Importing the Mocha tracking data to AE is much easier with MochaImport.

                    Here you find the download and a lot of video tutorials about it:

                     

                    http://www.mamoworld.com/images/stories/scripts/thumbnails/mochaimport.png

                    The function you need is "move selected layer (or new NULL)"

                    • 7. Re: Motion tracking issues
                      Molgaard Level 1

                      Thanks Mathias, I'll check that out.

                       

                      Rick, that was a beautiful explanation, and exactly how I would expect it to work. I did all those things and got myself a pixel-perfect track on Mocha from start to end. However, things continue to fall apart once I bring the data into AE. I imported it in exactly the way you described, using a null object and removing the anchor points etc. The sky does move at the right time, but the tracking resembles nothing the way it looked in Mocha. It's a big improvement over yesterday's results, but the sky is still shifting way off course. I've tried changing both the tracking and the splines but I always get the same results. I must still be doing something wrong.

                       

                      I'll try the thing Mathias suggested and report back.

                       

                      Thanks guys.