If you work with video or audio on macOS, FFmpeg is a must-have tool for transcoding, trimming, extracting audio, and more. In community threads, a common question pops up when setting up a new machine: how to install FFmpeg correctly using Homebrew, what extras you get out of the box, and how to verify that everything works.
Hi all,
I am setting up a Mac and want to use FFmpeg for video conversions and quick edits. How do I install FFmpeg with Homebrew (brew install ffmpeg), verify the installation, and handle common issues like PATH problems or missing codecs? I would also love a quick example command to confirm it is working.
Great question. Homebrew is the easiest and most reliable way to install FFmpeg on macOS. Below is a practical, step-by-step process, along with verification tips, common fixes, and a quick usage test.
Install Apple Command Line Tools if you have not already with xcode-select --install . Then, check if Homebrew is installed with brew -v
If you don’t see a version, install Homebrew using the official script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Code language: JavaScript (javascript)
brew update
brew doctor
brew install ffmpeg
Homebrew will install FFmpeg and all of its required dependencies. For most workflows, the defaults cover H.264, H.265, AAC, and widely used formats. If you truly need custom codecs, you can explore third-party taps that offer variant builds.
# Confirm FFmpeg is on your PATH
which ffmpeg
# Print version and enabled libraries
ffmpeg -version
# Show available decoders and encoders
ffmpeg -decoders | head
ffmpeg -encoders | head
To check for specific codecs, search the lists:
ffmpeg -encoders | grep 264
ffmpeg -decoders | grep aacCode language: PHP (php)
On Apple Silicon Macs, Homebrew typically lives in /opt/homebrew. On Intel, it is often /usr/local. Ensure your shell profile includes the correct bin path.
# For zsh (default on macOS)
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# For bash
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profileCode language: PHP (php)
- Convert a video to MP4 with H.264 and AAC:
ffmpeg -i input.mov -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 160k output.mp4
- Extract audio as MP3:
ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3
- Create a 5-second clip from the start:
ffmpeg -ss 0 -i input.mp4 -t 5 -c copy clip.mp4
- FFmpeg not found after install: ensure PATH is set correctly and reopen your terminal.
- Codec missing: check
ffmpeg -codecsto confirm availability. If missing, consider reinstalling or exploring alternative formula variants. - Runtime errors about libraries: try
brew update,brew upgrade, thenbrew reinstall ffmpeg.
If you are new to FFmpeg or want to understand when and why to choose formats and codecs, these guides are practical reads:
- FFmpeg features, use cases, and pros and cons
- Video encoding basics and best practices
- MP4 vs WebM considerations
If you would rather offload transcoding, thumbnails, or streaming variants at scale, Cloudinary can handle uploads and on-the-fly transformations for you. For example, upload a video and deliver a resized MP4:
# After uploading my-video.mp4 to Cloudinary:
https://res.cloudinary.com//video/upload/w_1280,c_fill,q_auto/my-video.mp4Code language: PHP (php)
You can also provide alternate formats and bitrates for different devices without managing servers or pipelines yourself.
- Install via Homebrew:
brew install ffmpeg. - Verify with
ffmpeg -versionand quick conversions. - Fix PATH issues by adding Homebrew’s bin directory to your shell profile.
- Use FFmpeg locally for control and speed, or offload at scale using Cloudinary video transformations and delivery.
Ready to streamline video processing and delivery across your projects? Create a free Cloudinary account and start transforming media at scale.