0

Hi so I am having problems running ffmpeg on a folder of movie files with Mac's automator. My goal is to select a folder and right click/select service and automatically the Automator script (shell script using ffmpeg) should run on only movie files (of mp4 type). The shell script then modifies the mp4 files and moves them to another folder within that folder.

So I have a Automator workflow receives files or folders in finder. Then I have "Selected Finder items" and then run shell script (code below).

The "Selected finder items" works but I want to only select a folder and automatically the automator script should go in the folder and run the shell script on only mp4 files (movie).

Automator shell script that works:

====

for f in "$@" do /usr/local/bin/ffmpeg -i "$f" -map_metadata -1 -c:v copy -c:a copy "${f%.mp4}"-new.mp4; done

Now I am trying to move all converted mp4 files to a directory (converted) in the current directory with shell code that works like this:

====

for f in *.mp4; do ffmpeg -i "$f" -map_metadata -1 -c:v copy -c:a copy "converted/$f"; done

This shell script above works in terminal but doesn't work either in automator as I don't know how to move the ffmpeg output files into another directory via automator.

Please advise. Thanks!

New contributor
sd100 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

sd100 is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.