skip if file already exist?

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
tdx
Posts: 2
Joined: Wed Feb 01, 2017 7:18 pm

skip if file already exist?

Post by tdx »

is there a way to tell handbrake to skip encoding if the output file already exist, and move on to the next file ?

I looked through the help section and did not see any switch to do that.

This is what I used to encoded all the video files in a directory

Code: Select all

for %a in ("*.*") do "HandBrakeCLI.exe" -i "%a" -f mkv -e x264 -Z "H.264 MKV 1080p30" -a 1,2 -E faac,faac -B 192,192 -6 stereo,stereo -o "D:\OUTPUT\%~na.mkv"
Deleted User 11865

Re: skip if file already exist?

Post by Deleted User 11865 »

Which shell is this? Under bash, I'd do:

Code: Select all

for <condition>; do test -f <outfile> || HandBrakeCLI <other options> -o <outfile>; done
…there's gotta be something similar for your shell.
tdx
Posts: 2
Joined: Wed Feb 01, 2017 7:18 pm

Re: skip if file already exist?

Post by tdx »

Hi,

Im using DOS on windows 10, sorry im kind new to handbrakecli and not really good at scripting.

thanks
Post Reply