Answers.Body: <p>This is indeed possible with After Effects via its Scripting Interface, though this is a bit harder to use than Photoshop Actions. You will need to learn Adobe ExtendScript and how to use it in conjunction with After Effects.</p>
  
  <p>For this particular job I'd suggest a different approach using <a href="http://www.ffmpeg.org/download.html" rel="nofollow">FFmpeg</a>. It's an open source video encoding and processing tool that is used for many video automation tasks in the industry.
  You will have to write a script here aswell but that would be a LOT easier and shorter than digging into Adobe ExtendScript in conjunction with After Effects.</p>
  
  <p>Assuming you have an rendered video of your intro, outro and main media file in the same codec. You can then use the concat command in ffmpeg to mux the three file into one, which results in a joined video without any re-encoding of the source media.</p>
  
  <p>Here is a <a href="http://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files" rel="nofollow">tutorial</a> on how to do that in the Linux bash but you can do the same thing with AppleScript or Windows Batch script. You want to generate a filelist like shown in the tutorial:</p>
  
  <pre><code>file '/path/to/intro.mov'
  file '/path/to/main.mov'
  file '/path/to/outro.mov'
  </code></pre>
  
  <p>You would generate this filelist for every main media file and only change the path for your main media file for every "export".</p>
  
  <p>Just for reference, this is the final command you would then use:</p>
  
  <pre><code>ffmpeg -f concat -i filelist.txt -c copy output.mov
  </code></pre>
  
  <p>How the script part looks that comes before the FFmpeg command that generates the file list, completely depends on your operating system and or choice of scripting language.
  Note that you don't have to use the source codec, instead of doing <code>copy</code> you could also encode the output file into a different codec by specifying a codec with encode setting instead. </p>
  
  <p>For example:</p>
  
  <pre><code>-c:v libx264 -preset medium -f mp4
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-14T13:17:32.713Z
Answers.LastActivityDate: 2014-06-15T18:06:36.007Z
Answers.LastEditDate: 2014-06-15T18:06:36.007Z
Answers.UserDisplayName: timonsku
Answers.Body: <p>This is also possible with AviSynth.  I recently built a tool that generates a quick AVI Synth script for a video file, an intro and an outro, encodes the newly created video and then uploads it to Youtube.  AviSynth has a bit of a learning curve, but if you have some basic development knowledge, it is pretty easy to get working.  Here is the script I generated out.</p>
  
  <pre><code>videoMTS="G:\terra\video projects\camera dump may 2014\00016.MTS"
  ffindex(videoMTS)
  videoFeed = Trim(Audiodub(FFvideosource(videoMTS, fpsnum=2997,fpsden=100), FFaudiosource(videoMTS)),120,1022)
  
  vidWidth = Width(videoFeed)
  vidHeight = Height(videoFeed)
  vidFPS = FrameRate(videoFeed)
  
  openImage=ImageSource("G:\terra\tool development\Proverbs---Opening-Picture.jpg", end=180, fps=vidFPS)
  closeImage=ImageSource("G:\terra\tool development\Terra Nova - Closing Picture.jpg", end=180, fps=vidFPS)
  
  BlankAudio=BlankClip(clip=videoFeed,length=180)
  
  openImageAudio=AudioDub(openImage,BlankAudio)
  closeImageAudio=AudioDub(closeImage,BlankAudio)
  
  openImageSized=ConvertToYV12(BicubicResize(openImageAudio, vidWidth, vidHeight, 0.0, 0.75))
  closeImageSized=ConvertToYV12(BicubicResize(closeImageAudio, vidWidth, vidHeight, 0.0, 0.75))
  
  Dissolve(openImageSized,videoFeed,30)
  Dissolve(last,closeImageSized,30)
  </code></pre>
  
  <p>It had a few tricks because I was working with an MTS file and two images, so I had to do some initial processing to make them work together.  They kay parts are getting the width and height and framerate of the main video, making sure it matches up with the clips being used as intro and outro and then scaling them appropriately.  I then add a dissolve for each with a 30 frame duration.</p>
  
  <p>This just goes in a file with an avs extension and can then be opened by FFMPEG or most other encoders as long as AVISynth is properly installed.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-15T18:05:08.290Z
Answers.LastActivityDate: 2014-06-15T18:05:08.290Z
Answers.UserDisplayName: AJ Henderson
Body: <p>I am fairly new to video editing but I have a ton of video files that I need to add an intro and outro to. I do a lot of other print work and in photoshop I can batch file folders to repeat the same action to all the files in the folder. I would imagine there is some way of adding the intro and outro in the same manner with a video editing program like Adobe After Effects so I can select the folder and automates all the adding and publishing. Is this possible with any system??? </p>
  
Tags: <after-effects><video-editor>
Title: Add intro and outro to multiple files (batch)
UserDisplayName: packy
ThreadText: # Add intro and outro to multiple files (batch)
  
  (Asked by: username_0 on 2014-06-13)
  
  I am fairly new to video editing but I have a ton of video files that I need to add an intro and outro to. I do a lot of other print work and in photoshop I can batch file folders to repeat the same action to all the files in the folder. I would imagine there is some way of adding the intro and outro in the same manner with a video editing program like Adobe After Effects so I can select the folder and automates all the adding and publishing. Is this possible with any system???
  
  **Tags:** after-effects, video-editor
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-06-14. Score: 1
  
  This is indeed possible with After Effects via its Scripting Interface, though this is a bit harder to use than Photoshop Actions. You will need to learn Adobe ExtendScript and how to use it in conjunction with After Effects.
  
  For this particular job I'd suggest a different approach using [FFmpeg](http://www.ffmpeg.org/download.html). It's an open source video encoding and processing tool that is used for many video automation tasks in the industry.
  You will have to write a script here aswell but that would be a LOT easier and shorter than digging into Adobe ExtendScript in conjunction with After Effects.
  
  Assuming you have an rendered video of your intro, outro and main media file in the same codec. You can then use the concat command in ffmpeg to mux the three file into one, which results in a joined video without any re-encoding of the source media.
  
  Here is a [tutorial](http://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files) on how to do that in the Linux bash but you can do the same thing with AppleScript or Windows Batch script. You want to generate a filelist like shown in the tutorial:
  
  ```
  file '/path/to/intro.mov'
  file '/path/to/main.mov'
  file '/path/to/outro.mov'
  
  ```
  
  You would generate this filelist for every main media file and only change the path for your main media file for every "export".
  
  Just for reference, this is the final command you would then use:
  
  ```
  ffmpeg -f concat -i filelist.txt -c copy output.mov
  
  ```
  
  How the script part looks that comes before the FFmpeg command that generates the file list, completely depends on your operating system and or choice of scripting language.
  Note that you don't have to use the source codec, instead of doing `copy` you could also encode the output file into a different codec by specifying a codec with encode setting instead.
  
  For example:
  
  ```
  -c:v libx264 -preset medium -f mp4
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2014-06-15. Score: 0
  
  This is also possible with AviSynth. I recently built a tool that generates a quick AVI Synth script for a video file, an intro and an outro, encodes the newly created video and then uploads it to Youtube. AviSynth has a bit of a learning curve, but if you have some basic development knowledge, it is pretty easy to get working. Here is the script I generated out.
  
  ```
  videoMTS="G:\terra\video projects\camera dump may 2014\00016.MTS"
  ffindex(videoMTS)
  videoFeed = Trim(Audiodub(FFvideosource(videoMTS, fpsnum=2997,fpsden=100), FFaudiosource(videoMTS)),120,1022)
  
  vidWidth = Width(videoFeed)
  vidHeight = Height(videoFeed)
  vidFPS = FrameRate(videoFeed)
  
  openImage=ImageSource("G:\terra\tool development\Proverbs---Opening-Picture.jpg", end=180, fps=vidFPS)
  closeImage=ImageSource("G:\terra\tool development\Terra Nova - Closing Picture.jpg", end=180, fps=vidFPS)
  
  BlankAudio=BlankClip(clip=videoFeed,length=180)
  
  openImageAudio=AudioDub(openImage,BlankAudio)
  closeImageAudio=AudioDub(closeImage,BlankAudio)
  
  openImageSized=ConvertToYV12(BicubicResize(openImageAudio, vidWidth, vidHeight, 0.0, 0.75))
  closeImageSized=ConvertToYV12(BicubicResize(closeImageAudio, vidWidth, vidHeight, 0.0, 0.75))
  
  Dissolve(openImageSized,videoFeed,30)
  Dissolve(last,closeImageSized,30)
  
  ```
  
  It had a few tricks because I was working with an MTS file and two images, so I had to do some initial processing to make them work together. They kay parts are getting the width and height and framerate of the main video, making sure it matches up with the clips being used as intro and outro and then scaling them appropriately. I then add a dissolve for each with a 30 frame duration.
  
  This just goes in a file with an avs extension and can then be opened by FFMPEG or most other encoders as long as AVISynth is properly installed.
  
  
  ---
  
  