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???


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. 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 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

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"
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)



openImageSized=ConvertToYV12(BicubicResize(openImageAudio, vidWidth, vidHeight, 0.0, 0.75))
closeImageSized=ConvertToYV12(BicubicResize(closeImageAudio, vidWidth, vidHeight, 0.0, 0.75))


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.