Using automator and handbrake cli to convert videos automatically
Solution 1:
Process in the background
Ideally, your script needs to complete as quickly as possible. The easiest way is to spin off the processing of the movies into background processes. You can do this by adding a space and an ampersand &
to the end of your HandBrakeCLI
line.
Move before processing
However, this does not solve the problem of new files being ignored. In fact, your files could now be processed twice if the processing is not finished before the next new file appears.
Your script should move each new file to another unmonitored folder before processing begins. Consider adding a mv
command before your HandBrakeCLI
line. Alternatively, you could have Automator perform the move.
The destination folder should ideally be on the same drive, so it completes quickly and does not delay the script.