ffmpegdeveloper-toolsvideo-encoding

How to Install FFmpeg (Windows, macOS, and Linux)

·Javid Jamae·11 min read
How to Install FFmpeg (Windows, macOS, and Linux)

You need FFmpeg for one specific job, and the official download page hands you a source tarball, a list of third-party build servers, and a wall of ./configure flags. Nobody wants to compile a media framework to crop a video. Below is one command per operating system, the check that proves it worked, and the fix for the error most people hit ten seconds later.

Quick answer: The fastest FFmpeg install is a single package-manager command: winget install --id=Gyan.FFmpeg -e on Windows, brew install ffmpeg on macOS, and sudo apt update && sudo apt install ffmpeg on Ubuntu or Debian. Confirm it worked by running ffmpeg -version, which prints the build number and configuration flags. If that command returns "not recognized" or "command not found," FFmpeg is on disk but its bin folder isn't on your PATH.

Conventional wisdom says installing FFmpeg is the hard part. It isn't. On all three platforms it's one line and under two minutes. What actually costs people an afternoon is that the machine they installed it on is rarely the machine that needs it. FFmpeg works in your terminal, then fails in cron, in a Docker image, in a Lambda function, or on a teammate's laptop, because each of those is a separate install with a separate PATH. Do the local install now, then read the last section before you ship it anywhere.

How to install FFmpeg on Windows

Use winget. It ships with Windows 10 (build 1809+) and Windows 11, so there's nothing to install first.

winget install --id=Gyan.FFmpeg -e

That pulls the gyan.dev build, the same one the FFmpeg project links from its own download page. Close your terminal and open a new one: winget updates the PATH for future sessions, not the one you're sitting in.

Chocolatey and Scoop alternatives

If you already run a package manager, use it instead of adding a second one:

choco install ffmpeg-full
scoop install main/ffmpeg

Scoop is the right pick on a locked-down work laptop. It installs into %USERPROFILE%\scoop and needs no admin rights.

The manual install (and why you'd bother)

Go manual when you want a specific build, like a full GPL build with NVENC hardware encoding. Download ffmpeg-release-full.7z or ffmpeg-release-essentials.zip from gyan.dev, or grab a nightly from the BtbN builds repo on GitHub. The essentials zip is around 80 MB.

  1. Extract the archive to C:\ffmpeg. You should end up with C:\ffmpeg\bin\ffmpeg.exe.
  2. Add C:\ffmpeg\bin to your PATH.
  3. Open a fresh terminal and run ffmpeg -version.

For step 2, use PowerShell rather than setx. The old setx PATH trick silently truncates your PATH at 1024 characters, which has destroyed a lot of dev environments:

[Environment]::SetEnvironmentVariable(
  "Path",
  [Environment]::GetEnvironmentVariable("Path", "User") + ";C:\ffmpeg\bin",
  "User"
)

Installing FFmpeg on macOS

Homebrew is the answer on macOS. One command:

brew install ffmpeg

Homebrew's ffmpeg formula is a fat build. It links libx264, libx265, libvpx, libopus, libvorbis, and dozens of other libraries, so you get every encoder most people need without touching a compiler. It also pulls a long dependency chain, so budget a few hundred MB of disk and a couple of minutes on first run.

If you don't have Homebrew yet:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

One macOS-specific gotcha: on Apple Silicon, Homebrew installs to /opt/homebrew/bin, not the Intel-era /usr/local/bin. If ffmpeg isn't found after install, that's almost always why. Add this to ~/.zprofile and restart your terminal:

eval "$(/opt/homebrew/bin/brew shellenv)"

MacPorts users can run sudo port install ffmpeg instead. Don't run both package managers on the same machine unless you enjoy debugging which ffmpeg your shell picked.

How to install FFmpeg on Linux

Every major distro ships FFmpeg in its default repositories. Pick your line:

DistroCommandNotes
Ubuntu / Debian`sudo apt update && sudo apt install ffmpeg`Ubuntu 22.04 ships 4.4.2; 24.04 ships 6.1.1
Fedora`sudo dnf install ffmpeg-free`Codec-restricted build, see below
Arch / Manjaro`sudo pacman -S ffmpeg`Always current
Alpine (Docker)`apk add ffmpeg`Smallest footprint, good for images
RHEL / RockyEnable EPEL + RPM Fusion firstNot in base repos

Fedora's default ffmpeg-free package strips patent-encumbered codecs, so libx264 is missing and -c:v libx264 fails outright. For the full build, add RPM Fusion:

sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install ffmpeg --allowerasing

When the distro version is too old

Ubuntu 22.04 LTS is still on FFmpeg 4.4.2, released in 2021. Filters and flags added since then won't exist, and the error you get is a confusing Unrecognized option rather than anything about versions. The clean fix on any x86-64 Linux box is a static build, a single self-contained binary with no dependencies:

wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
tar xf ffmpeg-release-amd64-static.tar.xz
sudo cp ffmpeg-*-static/ffmpeg ffmpeg-*-static/ffprobe /usr/local/bin/

It's also the standard trick for Docker images and CI runners where the base image build is old.

Verify your FFmpeg installation actually works

Printing the version proves the binary is on your PATH. It does not prove the encoder you need is compiled in. Run all three:

ffmpeg -version
ffprobe -version
ffmpeg -hide_banner -encoders | grep libx264

Then do a real encode. This generates a five-second test pattern and encodes it to H.264, no input file needed:

ffmpeg -f lavfi -i testsrc=size=640x360:rate=30 -t 5 \
  -c:v libx264 -pix_fmt yuv420p test.mp4

If that writes a playable test.mp4, your install is genuinely finished. If it errors with Unknown encoder 'libx264', you have a codec-restricted build (see the Fedora note) and need a different package.

ffprobe came along for the ride, and you'll reach for it constantly. Our guide to inspecting video metadata with ffprobe covers what to check before you process anything.

Fixing "ffmpeg is not recognized" and other PATH problems

This is the most common post-install failure, and it means the same thing on every OS: the binary exists, but your shell doesn't know where to look. The exact error text differs.

  • Windows: 'ffmpeg' is not recognized as an internal or external command, operable program or batch file.
  • macOS with zsh: zsh: command not found: ffmpeg
  • Linux with bash: bash: ffmpeg: command not found

Work through these in order:

  1. Open a new terminal. PATH changes never apply to already-running shells. This fixes it maybe half the time.
  2. Find the binary. Run where ffmpeg on Windows or which -a ffmpeg on macOS and Linux. No output means it isn't on PATH; multiple lines mean you have two installs fighting.
  3. Print your PATH. Use echo $PATH in bash or zsh, or $env:PATH -split ';' in PowerShell. Confirm the folder containing ffmpeg is actually listed.
  4. Check you added the bin folder, not the parent. C:\ffmpeg is wrong. C:\ffmpeg\bin is right. This trips up nearly everyone doing a manual Windows install.
  5. Sign out and back in on Windows if a fresh terminal still fails. Some shells cache the environment per-session in ways a restart doesn't clear.

On macOS, a manually downloaded binary can also be blocked by Gatekeeper with "cannot be opened because the developer cannot be verified." Clear the quarantine attribute:

xattr -dr com.apple.quarantine ./ffmpeg

Common pitfalls after installing FFmpeg

These are the ones that show up after the install "worked."

It runs in your terminal but fails in cron. Cron runs with a minimal PATH, typically just /usr/bin:/bin. If FFmpeg lives in /usr/local/bin, your cron job dies with exit code 127. Use the absolute path in the crontab: /usr/local/bin/ffmpeg -i ....

It works locally but not in your app. Node's child_process.spawn and Python's subprocess inherit the environment of the process that launched them, which for a systemd service or a GUI app is not your login shell. Same fix: absolute paths.

You installed it locally and forgot the server needs it too. Your Dockerfile, your CI runner, and your production host are three more installs. See running FFmpeg in GitHub Actions for the CI-specific version of this problem.

Two copies, wrong one wins. A Homebrew install plus a manually extracted binary means which -a ffmpeg returns two paths, and the first on PATH wins, which may be the older one. Remove one.

H.264 output won't play in browsers or QuickTime. Not an install problem. Add -pix_fmt yuv420p. FFmpeg defaults to a chroma subsampling that most players reject.

When you shouldn't install FFmpeg at all

Install it locally if you're learning filters, doing one-off conversions, batch-processing files on your own machine, or debugging a command before you automate it. Good reason, and the install above takes two minutes.

Don't install it if the goal is running FFmpeg inside something: a web app, a scheduled job, an n8n or Make workflow, or an AI agent. The cost there isn't the install command. It's the ~100 MB binary in your deploy artifact, the CPU spikes that leave your web server unresponsive during an encode, the job queue you have to build because a 10-minute transcode outlives an HTTP request, and the platform limits: AWS Lambda's 250 MB unzipped layer cap and 15-minute timeout, Cloudflare Workers with no filesystem, Vercel serverless functions with no persistent disk.

Install FFmpeg yourselfOne API call
SetupBinary + PATH on every environmentHTTP request, no servers to run
Long jobsYour own queue and workerSubmit a job, poll or webhook
ScalingYou size and pay for the machinesHandled, usage-based
Version driftDifferent build per environmentOne managed toolkit

FFmpeg Micro is the FFmpeg API: the same operations you'd run from the CLI, exposed as a REST endpoint, an MCP server for AI agents, and copy-paste steps for n8n, Make, and Zapier. We wrote up the full cost comparison of cloud FFmpeg versus self-hosting if you want the numbers rather than the argument.

FAQ

Is FFmpeg free to install?

Yes. FFmpeg is free and open source, licensed under LGPL 2.1 or later, though most distributed binaries include GPL components like libx264 and are therefore distributed under the GPL. There's no cost, no account, and no license key for any of the installs on this page.

How do I install FFmpeg on Windows without admin rights?

Use Scoop (scoop install main/ffmpeg), which installs entirely inside your user profile. Or extract the gyan.dev zip to a folder you own, such as C:\Users\you\ffmpeg, and add its bin subfolder to your user PATH rather than the system PATH. Neither approach needs an administrator.

Do I still need FFmpeg installed if I use ffmpeg-python or fluent-ffmpeg?

Yes. Libraries like ffmpeg-python, fluent-ffmpeg, and moviepy are wrappers that build a command string and shell out to the ffmpeg binary. They do not bundle it. If the binary isn't on PATH, they fail with the same "command not found" error, just wrapped in a stack trace.

How do I update FFmpeg after installing it?

Run your package manager's upgrade command: winget upgrade Gyan.FFmpeg, brew upgrade ffmpeg, sudo apt update && sudo apt upgrade ffmpeg, or sudo pacman -Syu ffmpeg. If you installed manually or from a static build, download the new archive and overwrite the binary. There's no self-update inside FFmpeg itself.

Which FFmpeg version should I install?

Take whatever your package manager gives you unless a specific filter or flag you need is missing. Ubuntu LTS releases lag by years, so if you're on 22.04 and hitting Unrecognized option, switch to a static build instead of fighting the repo version.

Want to test a command first? Paste it into the FFmpeg Micro playground and run it without installing anything, then check the docs for the API version of the same operation. Sign up free when you're ready to move that step off your laptop.

About Javid Jamae

Founder & CEO at FFmpeg Micro

Javid is a software engineer, author, and entrepreneur with over 25 years of professional software development experience across enterprise, startup, and consulting environments. He founded FFmpeg Micro to make video processing accessible to developers through a simple, automation-first REST API.

Software EngineeringVideo ProcessingFFmpegCloud ArchitectureAPI DesignAutomation

Ready to process videos at scale?

Start using FFmpeg Micro's simple API today. No infrastructure required.

Get Started Free