If you frequently find yourself needing to encode files, you can speed this process up by adding a service. You can then transcode your files by right clicking, hovering over the services option, and then selecting your encoding service. Could it get any easier? No.
Get started:
First of all make sure you have ffmpeg installed. You can do this by following my guide here.
- Launch the Automator.app
- Select File > New to create a new service with service receives files or folders in any application
- Add a Run Shell Script action from the Action library
- Set Pass input: to as arguments (top right dropdown of the Shell script action window)
- Within the script, replace
echowith the script below to transcode video to MP4. (You can tailor this script for any common transcode or repackage job, such as mkv to mp4). - Save your workflow as a service.

The MP4 encode script:
for f in "$@"
do
/opt/local/bin/ffmpeg -i "$f" -c:v libx264 -crf 20 -c:a
ac -q:a 100 "${f%.*}.mp4"
done
Tips
Change the CRF value of the above code to a higher figure for a lower quality encode (or vice-versa). For instance, you could create a high quality encode service and a low quality encode service.
You can also encode WMV from MP4 using the following code:
ffmpeg -i input.mp4 -q:a 2 -q:v 2 -vcodec msmpeg4 -acodec wmav2 output.wmv

Leave a Reply