I am having trouble running a shell script from Keyboard Maestro that worked perfectly on another laptop. I recently got a new laptop, migrated everything across, but something is not working quite right.
The shell script I have is one that is triggered when a file gets added to a folder. It then runs an ffmpeg command, converting the video to another folder.
The shell script looks like this:
ffmpeg -i "$KMVAR_FileName" -filter:v fps=30 -preset fast -crf 28 "$KMVAR_FileNameNew"
The KMVARs have valid values.
If I run this script in terminal, it does exactly what it should do:
ffmpeg -i a.mp4 -filter:v fps=30 -preset fast -crf 28 b.mp4
But when the folder trigger happens (new file added) and it tries to run the shell script with the KMVARs in, it errors. The error log shows this:
2022-10-28 22:42:46 Execute a Shell Script failed with script error: text-script: line 1: ffmpeg: command not found. Macro “FFMpeg iMovie File” cancelled (while executing Execute Shell Script).
Now, I know that ffmpeg is installed, and I know it works in Terminal. But clearly there's something I've missed, and I have no idea whether this is a KM issue or something else. Given that this works perfectly on my old laptop, I assume it's an environment thing, a setting I have not yet applied to the new laptop.
Can anyone tell me what I need to do to get KM to run this?