Concatenate Video Files

Problem

You want to concatenate some of your video files to create one single video file.

Solution

import Draft

# Define input and output files
inputVideoFile1 = '//path/to/movie_clip_1.mov'
inputVideoFile2 = '//path/to/movie_clip_2.mov'
inputVideoFile3 = '//path/to/movie_clip_3.mov'
outputVideoFile = '//path/to/complete_movie.mov'

# Concatenate video files
Draft.ConcatenateVideoFiles( [ inputVideo1, inputVideo2, inputVideo3 ], outputVideo )

Discussion

In order to successfully concatenate video files, the input files must all share the same codec and all have the same file extension than the output file. The line:

Draft.ConcatenateVideoFiles( [ inputVideoFile1, inputVideoFile2, inputVideoFile3 ], outputVideoFile )

concatenates the three input video clips and writes the result back in outputVideoFile, respecting the order in which they appear in the list.