Created
January 24, 2021 13:59
-
-
Save TheJoeSchr/9da2ce630f80546dc1ae0f8dc2f3a54a to your computer and use it in GitHub Desktop.
Pad a video with an image using ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem you need to download ffmpeg from here: | |
rem https://ffmpeg.org/download.html | |
rem This batch file pads a | |
rem a video with an given image | |
rem its called like this | |
rem padVideo.bat videoname.mp4 paddingImage.jpg 2:00:00 | |
rem this would pad a 1920x1080 video to 2:00:00. | |
@echo off | |
ffmpeg -i %1 -loop 1 -t %3 -i %2 -f lavfi -t 1 -i anullsrc -filter_complex "[1:v]scale=1920x1080:force_original_aspect_ratio=decrease,pad=1920:1080:'(ow-iw)/2':'(oh-ih)/2'[i];[0:v][0:a][i][2:a] concat=n=2:v=1:a=1[v][a]" -c:v libx264 -c:a aac -map "[v]" -map "[a]" videoOut.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment