Hello I am trying to use a .bat file to watermark videos I upload to my website. I want the watermark to start 2/3 the way through the video. I've written the code below to do it:
set ffmpeg="C:\ffmpeg\bin\ffmpeg.exe"
set ffprobe="C:\ffmpeg\bin\ffprobe.exe"
setlocal disabledelayedexpansion
for %%a in ("H:\4 - Watermark Process\Before\*.mp4") do (
for /F "delims=" %%I in ('ffprobe -v quiet -show_entries format^=duration stream^=width -of csv^=p^=0:s^=x "%%a"') do set "duration=%%I"
echo Duration is: %duration%
do (
ffmpeg -i logo.png -y -v quiet -vf scale=%%I*0.25:-1 scaled.png
ffmpeg -i "%%a" -vf "movie=scaled.png [watermark]; [in][watermark] overlay=10:main_h-overlay_h:enable=gte(t\,duration*2/3) [out]" "H:\4 - Watermark Process\After\%%~na.mp4"
)
)
pause 10
The problem is I get a few errors
The first is the duration has no output when I use echo to see if it is working I get:
echo Duration is:
And I get other errors in my overlay code