11 Replies Latest reply on Feb 20, 2012 8:09 AM by Jon Coyopa

    Batch replacing files in After Effects

    Jon Coyopa

      I have a project that is a series of time lapse shots that was edited in Final Cut Pro.  I used jpegs that I created from the original raw files (.cr2) to do the edit.  I used Automatic Duck to send the edit to After Effects (CS5) to do some things I am unable to do in FCP and I want to replace the jpegs with the raw files for color correction.  When I select multiple jpegs in my project window, I am unable to replace any of the clips.  If I select a single jpeg, I can bring up the replace window and I'm left with 2 options.  The first is creating an image sequence, which will work for some of my shots (although I still have put those back in the composition, essentially re-editing the piece), but for many of the others, I don't use all of the images in the time lapse or skip some here and there.  I also mix frame lengths in several sequences, using varying lengths of 1s, 2s, 3s, and 4s, etc so having AE create an image sequence from the raw files doesn't work.  The other option is replaing each file one by one but with thousands of images, that is not really an option.  I tried the Immigration script from aescripts.com but that doesn't do what I need it to do either.  I'm sure the solution is right under my nose, but any help is greatly appreciated.

        • 1. Re: Batch replacing files in After Effects
          Dave LaRonde Level 6

          I'd go back to FCP & re-export with The Duck.  You can then Import the new AE project into the old one and use the Replace Footage trick of Option-Drag (Mac) to replace the old image sequence with the new one.

          • 2. Re: Batch replacing files in After Effects
            Jon Coyopa Level 1

            Are you suggesting exporting a new XML file using the Duck?

            • 3. Re: Batch replacing files in After Effects
              Dave LaRonde Level 6

              I was recommending a new XML, but there may be an alternative... IF the RAW files have the same file names as the jpegs.


              Move the jpegs from their current location on the hard drive to somewhere else.  Open the AE project; the image sequences show up as missing.  Move the RAW files into the location previously occupied by the jpegs.  Highlight a missing image sequence, and reconnect, pointing to the first RAW image. 


              Mind you, I've never had to do this, but it sounds like it ought to work.

              • 4. Re: Batch replacing files in After Effects
                Jon Coyopa Level 1

                Thanks for the advice but that didn't work.  I think the issue with that is that if you have more than one file selected in the project window, when you right click to replace the footage, everything except "reload footage" is greyed out.  I'm trying not to do this one by one.


                I don't want an image sequence, at least I don't want what AE refers to as an image sequence.  I have a bunch of comps that have 500 (or how ever many photos are in each sequence) staggered layers and those comps are nested within my master sequence.  So far, the only thing I can get AE to do with the raw files is make "image sequence" which don't work because I use a combination of frame lengths anywhere from 1 to 5 or more.


                Thanks for your help.  I'm still looking for answers.

                • 5. Re: Batch replacing files in After Effects
                  Dave LaRonde Level 6

                  Wait: in the original AE project file, you have all your JPEG images in one folder, correct?

                  If you quit AE, remove the Jpegs from their original file locations and open this project, AE tells you there are x number of footage files missing and the missing JPEGs show up as color bars, correct?

                  I assume file names are identical between RAW and JPEG, correct?

                  When you move the RAW files to into this project's footage folder, replacing the missing JPEG files, you are NOT running AE, correct?


                  If that's all correct, opening the AE project file should yield an error message of missing footage files.  These missing footage files show up in the project window as color bars.  Just double click on a single missing piece of footage.  Navigate to the folder where its RAW counterpart is located, and where all the other RAW images should be located.  Double-click on proper RAW file.  AE should reconnect to ALL the missing files.


                  Unless, of course, you have profound organizational problems, in which case a new XML from The Duck may be your only hope.

                  • 6. Re: Batch replacing files in After Effects
                    Jon Coyopa Level 1

                    I'm extremely organized so that isn't an issue.


                    What you're suggesting to do does work, but either AE creates and image sequence, which I don't want, or I have to do each file one by one.  I have thousands of individual images in this project so I'm trying my hardest to not do them one by one.  I'm essentially trying to do my online edit in AE and I'm looking for a way to batch replace the jpegs with the raw.

                    • 7. Re: Batch replacing files in After Effects
                      Dave LaRonde Level 6

                      Normally, you have to specify if you want image sequences.  It wouldn't something as simple as a check box that should be left unchecked as you replace footage, is it?

                      • 8. Re: Batch replacing files in After Effects
                        Jon Coyopa Level 1

                        When you right click an image in the project window to replace/relink the file and, in my case, navigate to the raw file, there is a check box labeled Camera Raw Sequence.  If I check it, AE creates an image sequence, which as I've said before I don't want.  If it is unchecked, I have to replace each file one by one.

                        • 9. Re: Batch replacing files in After Effects
                          Dave LaRonde Level 6

                          I have only two more things to suggest, and then I'm out of answers.


                          In the folder with the raw images, move in a file that is NOT a raw image, but is contained in the project: a quicktime movie, a logo, what have you.  Make AE think it's no longer where it was.  Then, when you Quit AE, open the project file, get the missing files error message of missing footage and see the footage files with color bars, double click on that missing "ringer" file, navigate to its new location, and AE should find all the missing footage.


                          That's the first suggestion.  The second is to restore default AE preferences, Quit AE & open the project, then see if it finds all the footage files as it does on every machine and every AE version I've ever used.


                          But I have to tell you: unless someone else chimes in with an obscure way of doing this, you indeed may have to reconnect one-by-one. 


                          Your workflow is quite irregular, and I don't think it's something that the code-writers anticipated.  You either have image sequences or you don't.  You don't have an odd mixture of sequential images with varying durations that over time constitute what appears to be an image sequence.

                          • 10. Re: Batch replacing files in After Effects
                            Jon Coyopa Level 1

                            Again, thanks for your help but still nothing seems to work.  I've emailed the people at aescripts.com to see if their scripts can help me.


                            Here is a more detailed description of my workflow just in case anyone that has any insight can help.


                            I have a bunch of time lapse shots and animations that were shot with a Canon 5D in RAW format to retain the best color space possible.  Using Adobe Lightroom, I processed the RAW files into jpegs for editing but I only processed the ones I was going to use in the edit (this is important later).  I used Final Cut Pro for my edit.  I took these 5616x3744 jpegs and put them in 4k sequences.  I adjusted the frame durations, some on 1s, 2s, 3,s etc, and nested those in a HD sequence for editing and animating.  Once I had finished the edit, I used Automatic Duck to send the project to After Effects to apply some effects, some animation that can't be done in FCP and to do the final color grade.  I need to replace all of those jpegs with the original RAW files.  Using the replace/relink tools already in After Effects, I can either do it one file at a time, which will take forever and isn't something I have time to do or I can have AE create image sequences.  The problem with the image sequence option is that it uses all of the RAW files when I only need some of them, I can't have varying frame durations and I have to essentially re-edit/animate the project since it just places the image sequence in the project window and not the timeline/comp.  I've tried every variation of making AE think files are offline but I'm still only left with the one by one or image sequence options.

                            • 11. Re: Batch replacing files in After Effects
                              Jon Coyopa Level 1

                              I found a solution to this problem. 




                              You need to run 2 searches in the script.  The first one to replace the folder and the second to replace the file extension.  My problem was I was only replacing the folder.  Once the script is done and you open the new AE project it creates, the files will be offline.  After you relink the first file, AE does the rest, just like Dave suggested.  Lloyd from aescripts.com is very helpful.