This shows how we can quickly convert a .mov file to .gif format using Automator and Apple’s quick actions

Convert .mov to .mp4 or .gif using Automator Quick Actions

turbonemesis

--

First things first, we are going to create a Mac “Quick Action” automator script which automatically converts .mov to .mp4 for you. Next we will create another Mac “Quick Action” automator script which instead outputs your movie files as .gifs. Let’s get started!

Prerequisites

  1. Install ffmpeg — either via a direct download or using brew:

Direct download:

Brew:

brew install ffmpeg

Automator script

2. On your mac, press cmd + space then type in the word Automator and click on the Automator app.

3. Click on New Document

4. Click on Quick Action, click Choose

5. Do a search for Run Shell Script, within the Automator app itself, then double click on the Run Shell Script item when found.

6. Next we need the shell syntax itself.

On receive movie files from any application, we are going to just simply run a custom shell command as follows:

(Please note, your ffmpeg path may be different from mine, make sure you use YOUR ffmpeg installation location path where it says /Applications/ffmpeg in the code snippet below — yours may be installed in a different location)

originalFilePath=$1
uuid=$(uuidgen)
uuidFilePath=$originalFilePath-$uuid
/Applications/ffmpeg -i $originalFilePath $uuidFilePath.mp4

This essentially just takes a movie file path as input using quick actions in finder, and outputs the movie file in .mp4 format, using a unique uuid in the destination path name just so that you won’t run into any file already exists errors. (I’m sure there’s a better way of doing the file duplication uuid part, for instance, in the ffmpeg docs it says you can pass in the -y flag to overwrite the files instead of using a uuid[2])

Fixing copyright permission issues

You may run into some copyright permissions issues when running your new quick action for the first time, elevating the permissions of the ffmpeg installation file helps, but let me know in the comments if anyone finds a better way around this.

chmod u+s /Applications/ffmpeg (Again, this is dependent on your ffmpeginstallation location)

One other thing I noticed was after you first capture like a screen recording, you might need to simply rename your .mov file prior to it allowing you to run your quick action successfully, without it complaining about copyright permissions, but I’m still looking into exactly why that is and how to get around it. I personally use parallels tools to capture most of my screen recordings, but this might not be an issue in just normal movies or when your movie is recorded via different applications/devices.

Save and run it!!

Just think what else you can do just knowing these simple tools!

A few ideas:

Another script to convert back to .mov format

Convert heic photos to jpeg or png or svg (https://www.reddit.com/r/editors/comments/778t43/heic_got_you_down_i_got_the_cure/)

Convert video to gif, etc..

ALL can be done via a similar ffmpeg command!

Bonus content — converting a movie file to gif

Follow steps one through five above.

Shell syntax:

(Please note, your ffmpeg path may be different from mine, make sure you use YOUR ffmpeg installation location path where it says /Applications/ffmpeg in the code snippet below — yours may be installed in a different location)

originalFilePath=$1
uuid=$(uuidgen)
uuidFilePath=$originalFilePath-$uuid
/Applications/ffmpeg -i $originalFilePath -filter_complex "[0:v] fps=20,scale=720:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" $uuidFilePath.gif

This converts the input movie file to gif for you just like that! There are other settings you can tweak to your liking too! Just be careful to not do this on a super long video, after all, who would want to watch a gif that’s longer than just a few seconds anyways? (Decrease the gif file size, only convert a portion of the original video, output different resolution and color settings, etc, etc — see reference(s) below[¹] for more info on the settings you can change to your liking)

References

--

--

turbonemesis

Just doing my part in helping contribute to the community