I am trying to create a batch file with 2 passes. Pass 1 scales the video. Pass 2 pads a border around it. They both work separately but will not work together.
Pass 1:
@echo off
REM Scale video to 1216x684
for %%a in (*.mp4) do ( ffmpeg -i "%%a" -vf scale=1216:684 -preset faster "output\%%~na.mp4"
)
pause
Pass 2:
@echo off
REM Pad video to 1280x720
for %%a in (*.mp4) do ( ffmpeg -i "%%a" -vf pad="1280:720:32:0" -preset faster "output\%%~na.mp4"
)
pause
Combined:
@echo off
REM Scale video to 1216x684 and pad to 1280x720
for %%a in (*.mp4) do ( ffmpeg -i "%%a" -vf scale=1216:684 -preset faster -pass 1 -f mp4 NUL && \
ffmpeg -i "%%a" -vf pad="1280:720:32:0" -preset faster -pass 2 "output\%%~na.mp4
)
pause
Error:
CRF/CQP is incompatible with 2pass. Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height Conversion failed!
What am I missing?