Reputation: 1297
I have this code to transcode a batch of videos to low res and add a watermark.
%~d1
CD "%~p1"
MD "Proxy"
attrib +h Proxy /s /d
for %%a in ("*.MOV") do ffmpeg -i "%%a" -i "M:\Box Sync\Batch Processing\ffmpeg\proxy.png" -filter_complex "overlay=0:0" -q:v 20 -q:a 0 "Proxy/%%~na.mp4"
attrib -h Proxy /s /d
PAUSE
How can I check to see if any output files already exist in \proxy\ and if so, to skip processing them?
Upvotes: 0
Views: 658
Reputation: 8969
You should simply be able to precede the ffmpeg with if not exist <file>
%~d1
CD "%~p1"
MD "Proxy"
attrib +h Proxy /s /d
for %%a in ("*.MOV") do if not exist "Proxy/%%~na.mp4" ffmpeg -i "%%a" -i "M:\Box Sync\Batch Processing\ffmpeg\proxy.png" -filter_complex "overlay=0:0" -q:v 20 -q:a 0 "Proxy/%%~na.mp4"
attrib -h Proxy /s /d
PAUSE
Upvotes: 2