I have 500+ videos. I need to add intro and outro to them.

Found this .bat script on a different website, and tried it. But it didn't work for me. As the script only ads outro - still didn't work.

SET INTRO="intro.mp4"

for %%a in ("%INPUT_FOLDER%\*.*") do ffmpeg -i %INTRO% -i "%%a" -filter_complex "[0:v]scale=%RESOLUTION%:force_original_aspect_ratio=1,pad=%RESOLUTION%:(ow-iw)/2:(oh-ih)/2[v0]; [1:v]scale=%RESOLUTION%:force_original_aspect_ratio=1,pad=%RESOLUTION%:(ow-iw)/2:(oh-ih)/2[v1]; [v0][0:a][v1][1:a]concat=n=2:v=1:a=1[v][a]" -map [v] -map [a] "%OUTPUT_FOLDER%\%%~na.mp4"

I'm on Windows OS, but I also have Linux Mint installed on my workstation.

My question is: how to add 1 intro and 1 outro to 500+ videos?

PS: Intro and Outro files are the same file.

Thank you.

  • No errors or log? Is the problem with your batch script or the ffmpeg command?
    – llogan
    Jul 29 '19 at 17:37
  • I ran the .bat file, but it didn't give me any error. Have to mention the batch script is located in the same place as the video files and intro/outro file -> 4 videos in total for testing purpose. I have no log. Jul 31 '19 at 4:39

Did you install ffmpeg? This script uses it so it'd be good to have it...

The Idea is that you create a txt-document with all the file-names inside, which will then get stitched together. You can read up on how it works here:


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.