I have been piecing together a shell script to use FFmpeg to validate video files in a folder and create a log file.
When run in the terminal from that folder, it works fine. When I incorporate it into Automator to use as a service, it fails to create the log file correctly.
It looks like the syntax I'm using causes an issue in Automator, and it's failing as it invokes FFmpeg. How do I adjust my script in Automator to give me the same result as I got in the Terminal?
Here is the script in Automator:
for f in "$@"
do
echo "$f"
cd $f
pwd
find -E ./ -regex '.*(.MOV|.MXF|.mp4|.MTS)$' -exec ffmpeg -v error -i {} -map 0:1 -f null - 2>error4.log \;
done
And the output from the log file:
find: ffmpeg: No such file or directory