13 Replies Latest reply on Dec 13, 2013 7:33 PM by Rick Gerard

    Motion Tracker with text on moving train

    sgribber Level 1

      I have a video clip of a train moving across the tracks.  The camera also pans to follow the path of the train.  I want text to sit on the top of the first car of the train as its travels from left to right.


      I used Track Camera and then parented text to the Null object. 


      The problem is that the text has to adjust in size and perspective as the train moves along.      I have tried keyframing these options but the result appears jittery and jumpy as if the text is dancing on top of the train.      The text should be the exact width of the first train.   Tiny in the distance and then large as it approaches cameras.  


      Also, there appears to be a bug with the text object not displaying the font correctly.   I have tried many fonts and each appears inconsistent.     I have attached a screen grab. 


      The red text is how the characters should appear given my font choice.  The red is NOT tied to the null object; its just a text layer.     The black font is tied to the null object.  You can obserce that certain characters are bold and others not. Overall this looks nothing like the font is supposed to appear.

      Please note that both titles are the same font.



      password for the vimeo clip is :  train-tracker



        • 1. Re: Motion Tracker with text on moving train
          Rick Gerard Adobe Community Professional & MVP

          I would use Mocha to plainer track the train enabling perspective then export corner pin data to AE to attach your text. That would be the easiest solution.

          1 person found this helpful
          • 2. Re: Motion Tracker with text on moving train
            sgribber Level 1

            Hi Rick,


            I tried Mocha and was able to export tracking data from my moving train.   Back in PP,   I create a null object and paste the tracking data into it.    The problem again is that the Text doesn't move correctly in relation to the train.   the perspective isn't correct and in some frames, the text completely flies off of the canvas area during playback.   The null object is rotating and moving in a way that doesn't match the path of the train that I carefully selected.


            I did notice that the planar grid doesn't match the perspective of the train.   


            thanks for any additional help!

            • 3. Re: Motion Tracker with text on moving train
              Dave LaRonde Level 7

              Do you HAVE to track it?  Aren't trains pretty much smooth-rolling, at a consistent speed?  Wouldn't a simple animation of the position (plus a couple of tweaks here and there) do the trick?


              You can make a couple of 3D solids, put the Grid effect on them, put them at a right angle to each other through the center, hook them to a null, and then position the null until the grids' perspectives look right.  The motion path for your text is where the grids intersect.

              • 4. Re: Motion Tracker with text on moving train
                Rick Gerard Adobe Community Professional & MVP

                You are not going about it in the right way. Establish a good track in Mocha, align the plane in Mocha, test it with a sample file or logo in mocha, then copy corner pin data in AE and apply that corner pin data to a text layer. If your track is not perfect, and it will probably take a little adjusting in Mocha, then your composite will jump. If you can test your track in Mocha and it's perfect enough, then it will be perfect enough in AE. I'm guessing, once you know how to use Mocha, it will take you about 15 minutes to get the track nailed down.


                You said back in PP and I think you meant back in AE you paste to a null... That's not right.  Check out this tutorial for the technique, make sure you get a good track, and you should be good to go. You will also need to create some hold out splines in Mocha and carefully adjust your track there. 


                To jack up the quality you can pull a procedural matte for the trees, isolate them, and have your text layer go behind the trees.

                • 5. Re: Motion Tracker with text on moving train
                  sgribber Level 1

                  Hi Rick,


                  Thanks for the help and the video link.  I watched a few more of the videos.     In Mocha, I established a track by selecting the train windows.  I also adjusted the plane around the 4 corners of the first train car.   Please see attached images.   The only visible tracking issue I encountered was when the train is obstructed by a yello Park sign at the end of the clip and a wooden box along the tracks at the very beginning of the clip.     Otherwise, the tracking stays on the windows very well.


                  I then exported the data and choose after effects corner pin.  Copy to clipboard.


                  Back in AE,   I create a text layer.   I now have 2 layers.  The video cilp and the text layer.   I pasted the mocha tracking data into the text layer and something really funky happens.   The text is shrunk and the perspective is bizaare.  See screen grab.   If you look closely, you can see the text is still there just extremely small. 


                  3 of the images with the plane& grid visible are from Mocha.  The 4th image is from AE.


                  I should add that my goal is for the text to ride just above the top of the first car.



                  • 6. Re: Motion Tracker with text on moving train
                    Roland Kahlenberg MVP & Adobe Community Professional

                    You have to ensure that the characters in your text reach the border of your comp. I believe this was stated as a requirement in the training video that Rick pointed you to. So, precomp the text (without any tracking data) and scale the text to fit the edges of the comp. Back in the 'final' comp, apply the Corner Pin tracking data to the nested/precomped text.


                    As an aside, mochaPro and mochaAE (not the mocha version bundled with AE - mochaAE CC) contains mocha's Camera Solve module which should work nicely on a shot such as this.



                    - Roland Kahlenberg

                    • 7. Re: Motion Tracker with text on moving train
                      sgribber Level 1

                      Hi Roland,


                      I followed your instructions and here's what I came up with.    Please find 7 screengrabs below.


                      In AE, I started completely fresh.   I have 1 layer in AE; the video clip.    I created a text layer and typed my name.   I right clicked on the text and selected pre-comp.   I then double clicked the pre-comp and increased the text size to fill the comp horizontally.  Please see my screen grab.  


                      I return to the original comp and paste my corner pin tracking data to the pre-comp.   


                      The final result looks like a splatter of paint on the face of the train.   Please see my attached screen-grabs for reference.



                      • 8. Re: Motion Tracker with text on moving train
                        Roland Kahlenberg MVP & Adobe Community Professional

                        1) Ensure that only one instance of Corner Pin is applied to the text and that it is applied in the comp with the backing plate.

                        2) Ensure that the comp where the Text Layer resides in, the precomp, has the exact same dimensions as the final comp - it should be as seen from the screen grabs you've provided.

                        3) Your mocha Surface in mocha is directly on the face of the train, so that's where the Corner Pin data will be placed. You may want to move the Surface  above the train and orientate the four points to suit your compositing needs/perspective. In mocha, I would also re-track with a larger tracking spline, to give mocha as much planar detail as possible. You should also keyframe the tracking spline to avoid objects that occlude the tracking area. Check your tracking data in mocha, using the Insert feature in the Layer Panel. Use the Adjust Track module if required.



                        - Roland Kahlenberg

                        • 9. Re: Motion Tracker with text on moving train
                          sgribber Level 1

                          Many thanks Roland.   


                          (1) Yes,  I believe there is only 1 instance of the Corner Pin.      What's a backing plate ?

                          (2) Yes, same dimensions. 1920 x 1080

                          (3) Yes, I turned on the Planar Surface and adjusted it so its above the train.  See screen grab.    I took your advice and re-tracked around the entire first train car instead of just the windows.

                          I tried to go into Manual Track to avoid objects but didn't have much success with this.


                          I used the insert feature and placed a jpg image into the Plane.  Looks prettty good from Mocha.


                          Back in AE nothing seems to work.


                          Why is the text looking so funky ?



                          • 10. Re: Motion Tracker with text on moving train
                            Roland Kahlenberg MVP & Adobe Community Professional

                            A backing plate is your background.

                            1) scale the text vertically, in the precomp, so that it reaches the top and bottom edges

                            2) the insert image on the top left looks like its pixelated/soft - does the pre-insert image look like that OR is mocha over stretching it?

                            3) Manual Tracking means moving the Planar Surface and NOT the tracking spline.

                            4) There are TWO Corner Pin tracking data that you can export from mocha - try both to see if you get better results from one of them

                            5) There is a good case to use mocha's Align Surface feature. The tutorial that Rick pointed you to, showed an example of this feature. The issue with the example in the video is that it didn't specify a very important requirement for Align Surface, which is to Align Surface at the frame where the insert layer/object is the largest on screen AND isn't cut off/cropped. In your task, it's the last frame - that's where the text is the largest in the shot. ENSURE that you duplicate the tracked layer (for backup) prior to invoking the Align Surface feature as there is no Un-align Surface. It's also important to note that with the Align Surface feature, your insert image/text has to be in perspective and at the exact location where you want it to be - the tutorial covers this.


                            My thoughts are if (4) doesn't solve your issue then (5) Align Surface should do the trick. I also suggest that you check that you have the latest version of your mocha app.


                            Good Luck!

                            - Roland Kahlenberg

                            1 person found this helpful
                            • 11. Re: Motion Tracker with text on moving train
                              Rick Gerard Adobe Community Professional & MVP

                              I'm with my friend Roland, use Align Surface. I made a quick screen cap or your movie and it took about 5 minutes to set up a track, adjust it, Align the surface and copy and paste the corner pin data to AE. The real trick is setting up some hold out splines in Mocha and setting the right splines for tracking. The more you try things like this the better results you will get.

                              • 12. Re: Motion Tracker with text on moving train
                                sgribber Level 1

                                Roland and Rick,


                                I can't thank you enough for taking the time to help me.    I ended up having some success with AE's 3D camera tracker instead of Mocha.   On this attempt, there were 2 options that made all of the difference for my purposes.


                                (1)  I masked out the large PARK sign as it was messing with the trackers results when the train passes over the sign.

                                (2)  Under shot type, I choose "Variable zoom". 


                                The tracking results were very good.   I had so many options.  I right-clicked and selcted create text and camera.   Adjusting the text was challenging b/c if I adjusted the position and rotation too much, I would get some drifting and bobbing.   I managed to get a good spot and the text now sits on the train really nicely.     


                                2 additional questions:


                                (1)Is there a way to get the text object to move 'under' the masked out YELLOW PARK sign.   I've got good tracking data here but the text moves on top of the sign, killing the illusion.  Please see attached image

                                (2)  If you look closely at the screen grab, the first half of the work  'a Loudbyte' is sitting lower than the last half of the title 'film'.  This angle changes as the train moves across the track.   I tried creating key frames for those particular points but as soon as I do playback, the TEXt jumps and bobbs and drifts.    



                                • 13. Re: Motion Tracker with text on moving train
                                  Rick Gerard Adobe Community Professional & MVP

                                  It's called rotoscoping. You duplicate the layer and then create an animated mask for the trees and the park sign. You then either use the masked copy as a track matte for the text or put it above the text layer.


                                  Rotobrush may do it but you also may be able to pull a procedural matte using channels. Type Masking or Roto in the AE search help at the top right corner of the app and then go through the training materials you will be pointed to.