Install ffmpeg on a Mac

Installation instructions for getting ffmpeg on your Mac, which donn’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.

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.

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…/Users/eric/Downloads/

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

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

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

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

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

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/

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/

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

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

I had the same problem as Chris. It might have something to do with El Capitan System Integrity Protection. Since installing El Capitan /usr/local/bin is either gone or inaccessible. I ended up moving the ff* files to the /usr/local/lib directory instead. Will that be ok?

Another, separate issue I had was that none of the ff* files would execute at first. If you have that issue it may be that you have System Preferences -> Security & Privacy -> General set to “Allow apps downloaded from:” Mac App Store and identified developers. I left that setting as is and used control-click and chose Open from the menu that appeared. Now all seems hunky dory.

Finally, many thanks to you Eric! I’ve tried following directions elsewhere and nowhere have I seen anything as clear as what you’ve provided. Kudos!

The problem people have been having is that in step 4 you show the command as “sudo mv ./ff* /user/local/bin/” when it should be “sudo mv ./ff* /usr/local/bin/” (usr instead of user). Great tutorial though!

Thank you! I had the same problem as some of the people above but fixed it after doing ls /usr/ which showed that there wasn’t a local folder but there was a bin folder: so I just removed “/local” from the code and everything worked perfectly.

Really appreciate your efforts here, as I’m totally clueless about *all* of this… but superuser.com has a 3-step process for installing ffmpeg using Homebrew. Could you look it over and tell me whether it looks OK?

One more question, I sometimes get an error “operation timed out” when I record live streaming videos.
Do you know how to prevent ffmpeg from stopping recording?
It might be my ISP issue but I want to keep recording without being timed out.

Thank you for being simple understanding and straight to the point. You have actually solved the issue but one thing that i would like to add without directing your knowledge is that you file names MUST be in lower cases and no addition symbols as “- , / ‘” etc etc that worked for me.. Thank Thank thank you. Globe Electronics

I had the same problem. Ffmpeg was correctly placed into the right directory and had executable permissions. It’s just that depending on your terminal style you might need to execute it by typing ‘./ffmpeg’, instead of just ‘ffmpeg’. The ‘./’ in front tells OSX to execute in the current directory instead of looking in the $PATH variable for where the ffmpeg app might be living.