Bash script not working on Automator but working from terminal
In addition to specifying the full path to ffmpeg two additional problems needed to be solved:


The path to the output files are also needed.
The pass input option of the shell script action has to be set as arguments.




The final script is then this:

#!/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 "$DIRNAME"/OUTPUT_"$name"."$extension" -vf 'scale=1920:1080' "$DIRNAME"/FINAL_"$name"."$extension"


done


Notice how the path was added to ffmpeg and also that $DIRNAME was added to the output files, that was not mentioned by the other question.