5 Replies Latest reply on Jun 16, 2015 7:59 AM by jasonvp

    Merging Videos via Command Line

    juliusf13648064

      Hi there,

       

      my question is a bit noobie, but i am not sure After Effects is capable of this.

       

      I want to automate a large number of video exports.

      Basicly i want to merge 3 videos together.

      Intro - Content - Credit

       

      The content has varying length.(This seems to be the main problem)

       

      So i think it is not possible to replace an video link inside the After Effects project if the content length is different.

       

      Is that right?

       

      I would love to use something like this:

      aerender -project projectFile.aep -replaceVideo nameInProject path/to/file.mov

       

      Any advices or ideas?

       

      Thanks in advance

        • 1. Re: Merging Videos via Command Line
          Dave LaRonde Level 6

          You'd probably be better off doing this kind of work in Permiere Pro if you have it.  The time you would save would more than compensate for the non-automated nature of the process.

          • 2. Re: Merging Videos via Command Line
            juliusf13648064 Level 1

            With the CC subscription i got it, but i was not aware of a command line Interface of Premiere Pro.

            • 3. Re: Merging Videos via Command Line
              Dave LaRonde Level 6

              I don't know it can be done via command line in any Adobe application.  But this is simple editing for a job like that, PP is far faster than AE would be even if you could automate it.

              • 4. Re: Merging Videos via Command Line
                Mylenium Most Valuable Participant

                You can do this easily in ffmpeg-based tools like Handbrake. No need to involve any Adobe tools.

                 

                Mylenium

                • 5. Re: Merging Videos via Command Line
                  jasonvp Level 3

                  Mylenium wrote:

                   

                  You can do this easily in ffmpeg-based tools like Handbrake. No need to involve any Adobe tools.

                  I've had to come up with a similar solution on my Mac because those STUPID GoPro cameras still insist on chunking up their MP4s into 4GB "bites".  It makes working with very long GoPro footage... um.. annoying.  But, in any event, I wrote a script on my Mac to use ffmpeg and GNU's readlink (greadlink) to do the trick.

                   

                  #!/bin/bash

                   

                  # Path to non-system binaries that we'll need.

                  #

                  # ffmpeg, the app that just keeps giving and giving.

                  FFMPEG=/opt/local/bin/ffmpeg

                  #

                  # Need to use GNU's readlink versus OS X's system one.

                  READLINK=/opt/local/bin/greadlink

                   

                  # Do some quick error checking.

                  if [ $# -le 2 ]

                  then

                          echo Usage: concat-vid input_vid1.mp4 input_vid2.mp4 ... input_vidN.mp4 output_vid.mp4

                          exit 1

                  fi

                   

                  ARGS=("$@")

                  ARGC=`expr $# - 1`

                   

                  OUTFILE=${ARGS[${ARGC}]}

                   

                  # Do the deed

                  ${FFMPEG} -f concat -i <(printf "file \'`${READLINK} -f %s`\'\n"\

                          `echo $@ | cut -d ' ' -f 1-${ARGC}`) -codec copy ${OUTFILE}

                  I just call it with "concat-vid some-vid*.mp4 output.mp4" and it does the deed.  This works fine for h.264 mp4s.  I dunno if it works for any other format as I haven't tried it.