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.

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…
/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
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.

Author: eric

Eric Holsinger is a software professional and photography enthusiast in Southern Maine.

43 thoughts on “Install ffmpeg on a Mac”

  1. Thank you for this, Eric — very helpful.

    I followed your instructions and everything seemed to work on my Mac. Now I am trying to cut a video into individual frames. The video is titled IMG_2299.MOV.

    I am using the following command: ffmpeg -i img_2299.mov $filename%12d.jpeg

    Two questions:
    1) where do I need the actual video saved for this to work? In the same folder as the ff* executable files (/usr/loca/bin)?
    2) And where will the images created be saved?

    Thank you,
    Kyle

  2. Eric, thank you for this blog. This is the first time I’ve found well written out instructions that explain what I’m doing when I download something and use my terminal, and I really appreciate it.

  3. Hi Eric! I’ve followed every steps and everything went well until the last step where i put this command:

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

    Then when I typed ‘ffmpeg’ and ‘Enter’ to check if it’s installed properly, this came out:

    -bash: ffmpeg: command not found

    May I know how to solve this? Thank you very much!

      1. I tried the baove steps and it says – -bash: ffmpeg: command not found, sudo find / -name ffmpeg – No such file or directory
        Can you help me out with this?

        1. 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.

  4. 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

  5. Hi Eric

    Do you know how to uninstall/remove ffmpeg from which you built?
    I’m not gonna do so now but I may in the future for some reasons.

    1. If it’s Unix (or Mac) you usually delete the directory; maybe any soft or hard links.

      You can use ‘which’ to find where your system thinks it is. Then ‘ls’ to see if it’s a link to someplace else.

      1. Thanks for your reply.
        I’ll make a note for it.

        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.

  6. Hi Eric
    This is Harry, I previously asked a question about recording webstream. I just figured out the issue myself so please ignore my previous enquiry. Sorry for the confusion!

  7. Hi Eric thanks for your introduction by which I successfully installed ffmpeg on my mac.

    I have an issue about recording live webstream video using ffmpeg.
    My friend suggested me to use ffmpeg to record webstream video but he uses ffmpeg for windows so I need your advice..

    This the command he uses in windows;

    “Drive:\ffmpeginstallationdirectory\bin\ffmpeg.exe” -i “url from step 4” -c copy “Drive:\outputdirectory\filename.filetype”

    For example, it’s something like this

    p:\ffmpeg\bin\ffmpeg.exe -i “https://lss.line-scdn.net/vod/hiqx1AUKvL15RQUAAJHY-bH4bOHBuLCJffil8a2RKbzpoeCUOcChwPmZObmZoKCYAfH15bWBAPW1ge3UKPC9-MWBPOmpo/720.m3u8” -c copy “p:\Video\Line Live video 20170101.ts”

    I tried to convert this command for mac and typed this way below.

    ffmpeg -i “https://lss.line-scdn.net/vod/hmsobopzkK1xGEkQDMyU6bmlIPHJ5LXVebyl9PyATbmh_KyENZyh0PnAZZW18LHEKaS0qancTOW92K3BPb3kpanZOODg/720.m3u8” -c:v copy -acodec copy “TEST.ts”

    But I got an error: “https protocol not found, recompile FFmpeg with openssl, gnutls or securetransport enabled.”
    I am not sure how to solve its issue and it might be wrong in my command.

    m3u8 is basically the format I want to record/download as ts file from the website.

  8. I have tried different variations based on the comments and I am receiving the following error message:

    mv: rename ./ffmpeg to /usr/bin/ffmpeg: Operation not permitted
    mv: rename ./ffprobe to /usr/bin/ffprobe: Operation not permitted
    mv: rename ./ffserver to /usr/bin/ffserver: Operation not permitted

  9. I’ve seen people saying both that it’s /usr/ as well as /user/? Which is the correct one?

    1. The /usr is for installed software while /user// is for your documents and pics and personal files and what-not.

      But, it’s your system. You can do whatever you like.

  10. 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.

  11. 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!

  12. Thanks for the instructions, Eric, very helpful for a noob like me. On my computer i didn’t have the usr/local/bin directory, but had to use usr/bin instead.

  13. It seems to be a typo here: user instead of usr
    sudo mv ./ff* /user/local/bin/

  14. 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!

  15. Hi Eric, I followed the tutorial and am able to download files from Youtube using Youtube-dl. However, if I try a site like CBS for some daytime shows I get this in the Terminal Box.

    https protocol not found, recompile FFmpeg with openssl, gnutls,
    or securetransport enabled.

    Could you explain how to initiate https

    Thanks in advance
    Mike

  16. I appreciate your putting the instruction up since your “how to” at least doesn’t require I install 5 different things before I can do anything. However, it didn’t work. Didn’t do anything at all.

    I typed in “sudo mv ./ff* /user/local/bin/” command as described and I got:

    “usage: mv [-f | -i | -n] [-v] source target
    mv [-f | -i | -n] [-v] source … directory”

    Then doing “ls /usr/local/bin/ff*” results in “No such file or directory.”

    Doing “ls” for the folder with the ffmpeg package (SnowLeopard_Lion_Mountain_Lion_Mavericks_Yosemite_El-Captain_28.12.2015) shows all three are still there:
    “ffmpeg ffprobe ffserver”

    So I dunno…

Comments are closed.