ffmpeg runs exactly like I want it to. I'm sure the following is not super clean but it does work with one exception: it simply adds the .mp4 to the original filename so that the new filename appears to have two extensions.
I've spent days searching for similar problems on multiple forums with no real help. I've tried copying and pasting suggestions with different errors. I would really like to drag a video file onto this applet and have it run ffmpeg the way I've specified in the shell portion with the resulting output file being created in the location of the input file but with a different extension.
I've tried the "filesString" way and the \"f\" + "{$f%.*}" and for whatever reason that doesn't seem to do anything but open terminal with the text of the shell. Other options result in a message stating that there's "NO SUITABLE OUTPUT" which I have finally figured out means, "whatever you're doing is great, but I'm going to give you this error until you take the spaces out of your file name/folders."
So:
To drop a file and have it convert to file with the standards specified. (check)
Have that output file go back to the folder where the input file lives. (check)
But with only the new extension. (fail)
A bonus would be to edit the script such that I could drop a folder of files onto the applet and have them convert 1 at a time. I believe I can drop a folder at this time but then it opens multiple instances of Terminal and processes simultaneously. I'd like to have the files process 1 at a time.
on run {input, parameters}
repeat with file_ in input
tell application "System Events"
set inputFilename to name of (get properties of file_)
end tell
set inputFilePath to quoted form of (POSIX path of file_)
set outputFilePath to quoted form of (POSIX path of file_)
tell application "Terminal"
activate
do script "/usr/local/Cellar/ffmpeg/3.0.2/bin/ffmpeg -i " & inputFilePath & " -aspect 4:3 -vf yadif=0:-1:0,scale=720:486 -acodec libfdk_aac -cutoff 20000 -vcodec libx264 -preset medium -pix_fmt yuv420p " & outputFilePath & ".mp4"
end tell
end repeat
return input
end run