ffmpeg working from command line in Terminal but not in an Automator shell script!
The Automator script does not automatically share your Terminal.app profile. Paths to additional tools may not be found because Automator's script can not find them.

Try expanding your script to include the absolute or full path to the ffmpeg you want to use:

for f in "$@"
do
    /opt/local/bin/ffmpeg -i "$f" -c:v copy -c:a aac -b:a 384k -strict -2 "${f%.*}.m4v"
done


Alternatively, bring in your Terminal.app profile using the approach to this question, My Automator Workflow fails because it fails to find the git command within the 'Run Shell Script' command? Need help.