shortz: How to Record Screen and Convert Video to GIF on macOS

Welcome! My name is Tomasz Buga, and this is shortz — short articles series that provides you solutions for your Software Development issues with simple to follow step-by-step guides.

How to record screen on macOS?

1 — Press CMD + Space to open the Spotlight Search

2 — Type QuickTime and press Enter to run the QuickTime Player app

3 — From the menu bar select File > New Screen Recording (or simply press Control + CMD + N)

4 — Set up options as you like and hit the Record button

QuickTime Player — New Screen Recording Toolbar. As you can see I’m using the Timer to make sure that I’m ready to record and I have set everything in the proper state.

5 — To stop recording press the Stop button on the menu bar (it’s located on the right side of the menu)

6 — If you’re satisfied with the result, you can save the video (default format is *.mov) on your Mac with File > Save or with CMD + S combo

How to convert video to GIF on macOS?

1 — Download the FFmpeg binaries (e.g., from here)

2 — Extract the *.7z archive file with a double-click

3 — Press CMD + Space to open the Spotlight Search

4 — Type Terminal and press Enter to run the Terminal app

5 — Type ls /usr/local/bin and hit Enter to see if there is a bin directory on your Mac (ls means listing & bin is an abbreviation for binaries)

6 — In case you'd receive a message: No such file or directory, please type sudo mkdir /usr/local/bin (sudo is short for superuser do & mkdir stands for make directory)

If you’d run mkdir for that particular location without sudo you’ll probably end up with the Permission denied message

7 — Once you have directory /usr/local/bin available — let’s copy the ffmpeg binaries that you extracted to that folder. Open Finder and from the menu bar select Go > Go to Folder… or press Shift + CMD + G

8 — Type /usr/local/bin and press the Go button

9 — Now move the ffmpeg binaries file from the folder where you extracted the *.7z file

9 — Now, go back to the Terminal app and navigate to the folder where you saved your video file using the cd command. In my case, it is cd Desktop Remember that cd is case sensitive, but you can use the TAB key to auto-fill the words/file names/directories names, etc.

10 — Now we’re going to use the command below to convert the video

At first, I changed the file name to movie.mov. Then I copied the ffmpeg -i part of the code, I typed “mo”, and pressed the TAB button to auto-fill the rest of the filename. As the last step, I’ve copied the last part of the commands and hit Enter button. That’s it!

How to add the “Convert to GIF” option to Finder’s context menu?

1 — Press CMD + Space to open the Spotlight Search

2 — Type Automator and press Enter to run the Automator app

3 — Select Quick Action option and press the Choose button

4 — Set up Quick Action options as follows:

  • Workflow receives current files or folders in Finder
  • Image: Video (or your choice)
  • Colour: Black (or your choice)

5 — Type shell in the search bar and double-click on the Run Shell Script

6 — Copy the code from below and paste it into Automator > Run Shell Script

If you want you can add a Notification once the script is done

7 — From the menu bar select File > Save or use the CMD + S combo and give your Quick Action pretty name (e.g., Convert to GIF)

8 — Now, use the Finder to navigate to the folder with your *.mov file and right-click on it

9 — You should see your new Quick Action available at the bottom of your Context menu. If not — expand the Quick Actions menu

10 — Click on the Convert to GIF

At the first launch there would be probably an issue with the Security settings that won’t allow you to launch your Quick Action, so here’s a short video tutorial (if it won’t load you can find the steps described below)

1 — Press CMD + Space to open the Spotlight Search

2— Type System Preferences and press Enter to run the System Preferences

3 — Select Security & Privacy option

4 — Navigate to the General tab

5 — Click on the Lock icon and provide your password/TouchID to unblock the settings

6 —If you had already closed the Convert to GIF warning modal window (if not press Cancel) then in Security & Privacy > General tab there should be an information thatffmpeg has been blocked…” — click Allow anyway button next to it

7 — Go to your *.mov file once again and now Convert to GIF will actually convert your file to GIF format

All the best,

Tomasz Buga, SDET

www.tomaszbuga.pl

Sources:

All illustrations made by Tomasz Buga

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tomasz Buga

Tomasz Buga

Software Development Engineer in Tests. Passionate about programming. Experienced, former employee of the insurance industry. Graphic designer by choice.