
FFmpeg: How to Add an Outro to Multiple Videos
Updated
Learn how to automatically add an outro clip to multiple videos at once using FFmpeg.
Before we begin, make sure you have FFmpeg installed on your system, your main video files ready as MP4s, and your outro clip named outro.mp4 placed inside the exact same folder.
Open your terminal or command prompt and navigate to your video folder.
Method 1: Same Resolution / Frame Rate
If all your source videos and your outro clip already have the exact same resolution and aspect ratio, you can run this simple loop:
for f in *.mp4; do [ "$f" = "outro.mp4" ] && continue; ffmpeg -i "$f" -i "outro.mp4" -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" "finished_${f}"; doneThis command loops through every MP4 file, skips outro.mp4 so it does not attach the outro to itself, concatenates the audio and video, and saves each updated video with finished_ added to the front of the filename.
Method 2: Different Resolution / Frame Rate
If your original videos and your outro clip have different resolutions, FFmpeg needs to rescale them so they match. In that case, use this command instead, which scales all clips to 1080p:
for f in *.mp4; do [ "$f" = "outro.mp4" ] && continue; ffmpeg -i "$f" -i outro.mp4 -filter_complex "[0:v]scale=1920:1080,setsar=1[v0]; [1:v]scale=1920:1080,setsar=1[v1]; [v0][0:a][v1][1:a] concat=n=2:v=1:a=1 [v][a]" -map "[v]" -map "[a]" "processed_$f"; done
Depending on the length and resolution of your videos, re-encoding can take a little bit of time, so just let the command run until your terminal prompt reappears.
Once it finishes, open your folder and play one of the newly created finished_ or processed_ files to verify that the video and audio transition into the outro smoothly.
As a quick tip, if you need a different resolution like 4K, simply change 1920:1080 in the script to 3840:2160 before running it.
Thanks for watching :)
