I have this bash script that works perfectly on terminal
#!/bin/bash for f in "$@"; do DIRNAME="$(dirname "$f")" filename=$(basename "$f") name="${filename%.*}" extension="${filename##*.}" /usr/local/bin/ffmpeg -i "$f" -filter_complex 'scale=1920:1080, pad=2134:1200:107:60' "$DIRNAME"/OUTPUT_"$name"."$extension" /usr/local/bin/ffmpeg -i OUTPUT_"$name"."$extension" -vf 'scale=1920:1080' FINAL_"$name"."$extension" done
I am trying to create a service for finder that accept movie files and process them using this script. The service is setup to pass input to stdin. When I select movies on finder and run that service, nothing happens. Like I said, the script works perfectly from terminal.
Any clues?
This question appears to similar to ffmpeg working from command line in Terminal but not in an Automator shell script! but applying the answer (full path to ffmpeg
) did not solve my problem.