I am using the code below to automatically watermark videos in a folder:
for %%a in ("C:\Users\Work\Desktop\Redo\*.mp4") do (
for /F "delims=" %%I in ('ffprobe -v quiet -show_entries stream^=width -of csv^=p^=0:s^=x %%a') do set "codec=%%I"
ffmpeg -i logo.png -y -v quiet -vf scale=!codec!*0.25:-1 scaled.png
ffmpeg -i "%%a" -vf "movie=scaled.png [watermark]; [in][watermark] overlay=10:main_h-overlay_h [out]" "C:\Users\Work\Desktop\Redo Done\%%~na.mp4"
)
Some of the videos fail to watermark and give the similar error below:
C:\Users\Work\Desktop\Redo\Arcade_h-overlay_h [out]: No such file or directory
I found out all videos with exclamation points (!) in the name do this.
How can I get these videos to watermark with an exclamation point in the title?