I'm a new user of FFmpeg, and I want to insert a logo on two videos (one video overlay another) with one command.
- FFmpeg command (ok):
ffmpeg -stream_loop -1 -i background1080p.mp4 -i input1080p.mp4 -i
logo.png -filter_complex
"[1]scale=1280:720[inner];[0][inner]overlay=70:70:shortest=1[vid];
[vid][2]overlay=10:10:enable='not(between(t\,10\,15))'[out]" -map
"[out]" -map 0:a -c:a copy -y -shortest output.mp4
When I use the above command, it works ok.
- FFmpeg command error
However, when I apply it to the command line below, I get an error:
@ECHO OFF
Setlocal EnableDelayedExpansion
set INPUT=D:\Shorts\code\INPUT
set OUTPUT=D:\Shorts\code\OUTPUT
:: encode video:
for %%a in ("%INPUT%\*.*") DO ffmpeg -i "%%a" -stream_loop -1 -i background.mp4 -i logo.png -filter_complex "[1]scale=1280:720[inner];[0][inner]overlay=70:70:shortest=1[vid]; [vid][2]overlay=10:10:enable='not(between(t\,10\,15))'[out]" -map "[out]" -map 0:a -c:a copy -shortest "%output%\%%~na_%%03d.mp4"
pause
- Main video (from
INPUT
folder) video andbackground.mp4
have their roles the other way round and what's supposed to be the overlay is the background.
Please help me fix the error