How to install FFMPEG on Mac OS 10.12?
macos - FFmpeg package for Apple Silicon - Stack Overflow
How do I locate and map ffmpeg after home… - Apple Community
qt - Run ffmpeg on Terminal MacOS - Stack Overflow
Videos
Factsheet
Bobby Bingham (libavfilter)
Bobby Bingham (libavfilter)
I don’t know how to install ffmpeg on my Mac. I have tried many different methods but none work.
There are four options, sorted by complexity:
- Homebrew (or other package managers)
- Static builds
- Docker
- Compile yourself
To follow this you need to have a bit of knowledge using a terminal/shell under macOS.
1. Homebrew
Homebrew has a formula for stable FFmpeg releases. This will get you running pretty fast. First, install Homebrew.
Then install FFmpeg through the ffmpeg formula:
brew install ffmpeg
This will download a lot of dependencies such as x264, but after that you should be good to go.
To update ffmpeg later on, run:
brew update && brew upgrade ffmpeg
2. Static Builds
The FFmpeg project, on the download page, offers links to static builds for ffmpeg, which you can just download, extract, and use in a terminal.
Static builds cannot contain every possible encoder, mostly due to licensing issues. If you don't care about the specific bundled encoders, this is a nice and portable solution.
Once downloaded, extract the file, open up Terminal.app, and navigate to the directory where you unzipped the files, i.e. where you find a file called ffmpeg. Copy this file to /usr/local/bin:
cd ~/Downloads/
sudo mkdir -p /usr/local/bin/
sudo cp ./ffmpeg /usr/local/bin
sudo chmod ugo+x /usr/local/bin/ffmpeg
Now, if you use zsh (which is the default shell since macOS Catalina), add it to your $PATH:
open -e ~/.zshrc
Add this to the file at the end:
export PATH="/usr/local/bin:$PATH"
If you are using Bash, instead edit this file:
open -e ~/.bash_profile
Save it, and close the editor. Now restart your Terminal and which ffmpeg should return /usr/local/bin/ffmpeg.
3. Docker
If you have Docker installed you can run a Docker container that comes with ffmpeg preinstalled.
There are various ffmpeg Docker images out there, for instance linuxserver/ffmpeg (see other answer below).
To run this image to convert an input.mkv file into an output file, open a Terminal and run:
docker run --rm -it \
-v $(pwd):/config \
linuxserver/ffmpeg \
-i /config/input.mkv \
-c:v libx264 \
-b:v 4M \
-vf scale=1280:720 \
-c:a copy \
/config/output.mkv
Note that $(pwd) will be your current working directory, and the command expects that directory to contain the referenced input file input.mkv. The file will be mounted into the container (into the /config directory).
4. Compiling yourself
You can of course build FFmpeg tools yourself, following the OS X compilation guide. This guide will always be up to date, and by manually compiling you may be able to tweak a few parameters.
This takes some time and experience with the shell, so it's not recommended unless you need to produce a specific build of ffmpeg.
To uninstall whatever version of FFmpeg you installed we'd need to know how you've installed it in the first place.
Since Homebrew will install to /opt/homebrew (for Intel-based Macs: /usr/local/Cellar), and symlink to /usr/local/bin/ffmpeg, it probably won't cause any problems with other libraries. However, check the make install scripts of the versions you (supposedly) built yourself and see where they placed FFmpeg. Then just delete them from there — it won't interfere with Homebrew.
The segmentation fault you got could be due to improper linking between the x264 or libvpx libraries. Since Homebrew will take care of this, you shouldn't run into any issues. However, I have occasionally run into an error like this when upgrading Homebrew dependencies without having upgraded ffmpeg — in this case, just brew reinstall ffmpeg and you should be good to go.
Install FFmpeg on the new ARM silicon (M1 chip): Install Rosetta2 via terminal using:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
Once Rosetta2 installed we can install Homebrew for ARM M1 chip:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Once the installation is finished, use the next Homebrew command to install ffmpeg:
arch -x86_64 brew install ffmpeg
You can compile ffmpeg for Apple Silicon by yourself. For this you will need Xcode, which comes with all the necessary tools.
You can download Xcode from the App Store, from Apple's website, or install the Xcode command line tools running xcode-select --install on the Terminal app.
After getting Xcode, you need to open it once to accept the terms and set up everything. You will be asked for your computer password.
After setting up Xcode, execute the following commands in that order, on the Terminal app, as a normal user (root is not necessary and not recommended). Lines beginning with # are comments and you should not execute them on the terminal.
# Create and go to a folder where you'll save the ffmpeg source code
mkdir -p /opt/local/src
cd /opt/local/src
# get the ffmpeg source code from the official source
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
# set up build and begin to compile
./configure --prefix=/opt/local
make
make install
# check that your compiled version of ffmpeg has arm64 (Apple Silicon) architecture
/opt/local/bin/ffmpeg -version
Looks like there's a working script and a built version now available at https://www.osxexperts.net
I am not technical savvy at all. I see YouTube videos, and they are useless because I have no idea how to install it. It is so confusing. And articles haven't helped me at all. I ALSO tried to contact mac support for help but they are scared to use terminal and don't know much about ffpeg, they can't even access third party articles on how to instal ffmpeg. I did ask them to do screen share but even then, they don't want to do it ughhhh.
You can install ffmpeg via three methods:
Downloading a static build from ffmpeg.org. Choose these if you want a simple-to-run program that comes with many features. You have to manually update it, though. Also, for licensing reasons, static builds cannot bundle all third-party dependencies.
Installing from Homebrew via
brew install ffmpeg. You get the most common dependencies (encoders etc.) installed along and it auto-updates when you update Homebrew.Building from source (see here). This usually is not required.
Some help for choosing a static build:
If you want a build that runs without any external dependencies, download a static build.
If you have a 64-Bit operating system (i.e. anything above OS X 10.7), download a 64-Bit build.
To answer your question by going off on a slight tangent.
I installed ffmpeg using Homebrew with brew install ffmpeg which has the advantage of building it and installing it with all the necessary requirements automatically. It builds the most recent stable version with commonly used dependencies.