Install ffmpeg on a Mac

To convert video file formats on your Mac, you’re going to want a great piece of open source software called “ffmpeg”. But, once you have it, it may not be clear how to get it working in your Mac. Here are the steps to get ffmpeg downloaded, placed into a folder so your system can find them, and how to make them executable and usable.

By: GotCredit

This is a long post about how to install ffmpeg, but it’s thorough and doesn’t assume you know how to use Terminal or how to execute commands.

Every step is outlined below with screenshots and some explanations of what the commands are, for the curious.

If you already know your way around the command line and just want to get to it, here are the steps:

  • download ffmpeg and extract the files
  • move the files to /usr/local/bin, using sudo
  • chmod, as sudo, the files to make them executable
  • try running ffmpeg to make sure it worked

1: download ffmpeg

For Mac users, you’ll get a compressed .zip file with a couple of files in it.

I downloaded to my Downloads directory, which is…

Check where your browser saved the file, find it with Finder and extract it by double clicking it. You should see a new folder with three files in it.

ffmpeg for Mac files
ffmpeg for Mac files

2: open up a Mac Terminal window
Now we are going to use some Terminal command line stuff to put the files where your Mac can find them, on demand.

Open up Terminal, your Mac command line shell. In Launchpad, just type Terminal to find it. It doesn’t look like much, but it’s where all the real power is. 🙂

type Terminal in Mac Launchpad
type Terminal in Mac Launchpad

When it opens, you’ll see a window you can type in and run commands. The “command line” where you type will have a “prompt” which is probably something that looks like…
your-computer-name:~ your-username$

Here is mine…

Mac Terminal window
Mac Terminal window

The “~” is your current directory, or folder. The “~” character is a special meaning for your user home directory; probably /Users/your-username.

When you change directories, the “~” will change to the name of your current directory.

Now that we have Terminal open, we can start moving files around.

3: change directories to see the ffmpeg files
First we need to change directories to where you downloaded the ffmpeg files and extracted the compressed zip file.

My files downloaded to my Downloads folder, so I am going to change to that directory.

To change directory we use the command “cd” followed by the directory name to which we want to move.

If you use Downloads for your web downloaded files, type the following:
cd Downloads

Then hit the return (enter) key to run the command.

Your command prompt should now look something like:
your-computer-name:Downloads your-username$

Then we will list the files in that directory to make sure we have them.

To list files in a directory, we use the command “ls”.

Type “ls” and hit the return key to run the command. You should see the downloaded .zip file and the expanded folder with the ffmpeg files.

If you have a bunch of files in your Downloads folder, you make see a long list of filenames; which may be confusing, visually.

Here is what my Terminal window looks like.

Terminal window with Downloads folder files listed
Terminal window with Downloads folder files listed

We are going to change directory into the folder with the ffmpeg files. You can see that the extracted folder is called ‘SnowLeopard_Lion_Mountain_Lion_Mavericks_Yosemite_18.03.2015’, which is the same as the .zip file, but without “.zip”.

Your folder name may be different, depending on the name of the .zip file you downloaded.

Change directory into the extracted folder (use the folder name you have, if different)…
cd SnowLeopard_Lion_Mountain_Lion_Mavericks_Yosemite_18.03.2015

Press return to run the command.

Now list the files there to make sure we are in the correct place; type “ls” and press return.

I can see the three files we need for ffmpeg listed in the folder.

ffmpeg files listed
ffmpeg files listed

4: copy the ffmpeg files to /usr/local/bin
We are going to move the ffmpeg files into a place where your Mac can find them and use them. A good place to store new command files is in a directory named /usr/local/bin.

The command to move files is “mv” followed by the files to be moved and the directory to move them.

But, we can’t just move files there. We have to do it as a “superuser”. If it’s your Mac, you’re probably the admin, which means you can do things as a superuser.

The command to run other commands as superuser is “sudo”. It will prompt you on the command-line to ask for your password when you run it.

To move the ffmpeg files, we are going to use a special character, “*”, as a wildcard.

Asterix, “*”, is the wildcard character.

All of the ffmpeg files start with “ff” in the extracted folder. We are going to move all files that start with “ff” in the current directory by using the wildcard in the file name, like this “./ff*”.

Dot, “.”, is the current directory.

The command to move all of the ffmpeg files which start with “ff” from the local directory to /usr/local/bin, as a superuser is…
sudo mv ./ff* /usr/local/bin/

Make sure you have the commands typed correctly and press return. You will be prompted to enter your password. Type it, it won’t display on the Terminal, and press return.

Your Terminal should show something like this:

move ffmpeg files to /usr/local/bin/
move ffmpeg files to /usr/local/bin/

If you list the files in the current folder, you should see none.

If you list the files in the /usr/local/bin folder, that start with “ff”, you should see the three files.
ls /usr/local/bin/ff*

listing ffmpeg files in /usr/local/bin/
listing ffmpeg files in /usr/local/bin/

5: make the ffmpeg files executable
Now we need to flag these new files as programs that your Mac can run. We do this by changing the mode flags for the files. We want to make them executable by adding the “x” flag.

To change mode flags on files, we use the command “chmod”. To add executability, we use “chmod +x” command.

We are going to add executability, as superuser, to all files starting with “ff” in the /usr/local/bin/ folder.

sudo chmod +x /usr/local/bin/ff*

Make sure that command looks correct and press return. You’ll probably have to confirm your password again, if too much time has passed since the last “sudo” command.

Try running the command “ffmpeg” to see if it works now. Just type “ffmpeg” at the command-line and press return. You should see something like this:

output from ffmpeg at the command line
output from ffmpeg at the command line

Well done!
If everything went well, ffmpeg is now installed on your Mac. You can use it to convert video formats.

If you enjoyed this post, make sure you subscribe to my RSS feed!

About Eric Holsinger

Eric Holsinger is a mobile app developer and hobbyist photographer. He lives near the coast in Southern Maine with with his wife and son.