Using Applescript in Automator app to run ffmpeg
This takes care of number 3, the double file extension issue.

I've modified the code below from your original code in the following ways:

Added the remove_extension(this_name) subroutine from the bottom of the Essential Sub-routines page.

Changed:

set outputFilePath to quoted form of (POSIX path of file_)


To:

set outputFilePath to quoted form of (my remove_extension(POSIX path of file_) &amp; ".mp4")


Removed &amp; ".mp4" from the end of the do script ... line.

I then tested it on an actual .mkv file and while the process started, nonetheless I did stop it shortly there after, as it was just a test to see the original filename.mkv was writing to filename.mp4, and it was.

on remove_extension(this_name)
    if this_name contains "." then
        set this_name to (the reverse of every character of this_name) as string
        set x to the offset of "." in this_name
        set this_name to (text (x + 1) thru -1 of this_name)
        set this_name to (the reverse of every character of this_name) as string
    end if
    return this_name
end remove_extension

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 (my remove_extension(POSIX path of file_) &amp; ".mp4")
        tell application "Terminal"
            activate
            do script "/usr/local/Cellar/ffmpeg/3.0.2/bin/ffmpeg -i " &amp; inputFilePath &amp; " -aspect 4:3 -vf yadif=0:-1:0,scale=720:486 -acodec libfdk_aac -cutoff 20000 -vcodec libx264 -preset medium -pix_fmt yuv420p " &amp; outputFilePath
        end tell
    end repeat
    return input
end run




If you want to use the AppleScript's text item delimiters method, wrapped in a subroutine, then replace the existing on remove_extension(this_name) subroutine with the following one, while leaving the others changes I made to your code as I did.

on remove_extension(this_name)
    try
        set oldDelims to AppleScript's text item delimiters
        set AppleScript's text item delimiters to {"."}
        if number of text items of this_name &gt; 1 then
            set this_name to (text items 1 thru -2 of this_name as text)
        end if
        set AppleScript's text item delimiters to oldDelims
    on error
        set AppleScript's text item delimiters to oldDelims
    end try
    return this_name
end remove_extension


This is essentially doing the same as the original on remove_extension(this_name) subroutine I first used, it's just a different method using what was mentioned in user14492's answer, only presented in what I'd consider to be a more proper form.