Install ffmpeg for yt-dlp on Windows, macOS and Linux
Quick answer
ffmpeg is a separate program, not a Python package, and yt-dlp needs it to merge the separate video and audio streams that every quality above 720p is served as. One command per platform:
winget install Gyan.FFmpeg
brew install ffmpeg
sudo apt install ffmpeg libavcodec-extra
What breaks without it
Not everything — which is why the problem is so often misdiagnosed. yt-dlp still runs, still downloads, still reports success. It just declines to choose any format that would need merging.
| Task | Without ffmpeg |
|---|---|
| 1080p and above | Silently downgraded to 360p |
| Merging video and audio | Aborts with an error |
| Extracting audio to mp3 | Fails |
| Embedding subtitles or thumbnails | Fails |
| Converting containers | Fails |
| SponsorBlock removal | Fails |
| A 360p download | Works fine |
That last row is the trap. A quick test succeeds, so ffmpeg looks unnecessary — until the quality turns out to be wrong. That is the whole of stuck at 360p.
Windows
winget, Scoop or Chocolatey all handle PATH, which is the step manual installs get wrong:
winget install Gyan.FFmpeg
scoop install ffmpeg
choco install ffmpeg # elevated prompt
Installing by hand: download a build, extract it somewhere permanent such as
C:\ffmpeg, and either add C:\ffmpeg\bin to PATH or point yt-dlp at it:
yt-dlp --ffmpeg-location "C:\ffmpeg\bin" "URL"
Simplest of all on Windows: put ffmpeg.exe and ffprobe.exe in the same
folder as yt-dlp.exe. yt-dlp looks there first, and nothing else needs changing.
macOS
brew install ffmpeg
sudo port install ffmpeg # MacPorts
Homebrew's build includes the encoders yt-dlp expects. If brew is not installed,
the macOS page covers it — and covers the Apple silicon
PATH problem that makes a successful install look like a failed one.
Linux
sudo apt install ffmpeg libavcodec-extra # Debian, Ubuntu
sudo dnf install ffmpeg # Fedora — needs RPM Fusion
sudo pacman -S ffmpeg # Arch
sudo zypper install ffmpeg # openSUSE
Unlike yt-dlp, the packaged ffmpeg is fine — it is not chasing a moving target, so a distribution build from last year still does the job.
On minimal and container images, ffmpeg alone can lack the MP3 encoder, and audio
extraction then fails with
ffmpeg exited with code 1. That is
what libavcodec-extra is for. On Fedora and RHEL, enable RPM Fusion first — ffmpeg
is not in the default repositories.
Android and Docker
pkg install ffmpeg
RUN apk add --no-cache ffmpeg # Alpine
RUN apt-get update && apt-get install -y ffmpeg # Debian-based
Full setups on the Termux and Docker pages.
Verifying the pairing
Two separate questions: is ffmpeg installed, and can yt-dlp see it. Both matter, and the second is the one that fails.
ffmpeg -version
ffprobe -version
yt-dlp --verbose --simulate "https://www.youtube.com/watch?v=jNQXAC9IVRw"
The verbose header lists the detected ffmpeg and ffprobe versions. not present
there, while your shell prints a version, means the two are looking at different PATHs — a
terminal opened before the install, or a scheduled task with no environment. Full diagnosis on
the ffmpeg not found page.
Making the location permanent
Rather than typing --ffmpeg-location every time, put it in your
config file:
--ffmpeg-location C:\ffmpeg\bin
A quick end-to-end check
This downloads a nineteen-second video at merged quality. If it produces one file above 360p, everything is wired up:
yt-dlp -f "bv*+ba/b" --merge-output-format mp4 "https://www.youtube.com/watch?v=jNQXAC9IVRw"
Frequently asked
Do I really need ffmpeg?
Which build should I download?
What is ffprobe and do I need it too?
Can I put ffmpeg next to yt-dlp instead of on PATH?
Related
- Fix "ffmpeg not found" and "You have requested merging" in yt-dlp yt-dlp downloads video and audio separately and needs ffmpeg to join them. How to install it on each OS, why "...
- Why yt-dlp Only Downloads 360p — and How to Get 1080p or 4K yt-dlp defaulting to 360p is a symptom, not a setting. The four causes — no ffmpeg, a PO token gate, a wrong f...
- Extract Audio with yt-dlp: MP3, M4A and Lossless Copies Ripping to MP3 re-encodes audio that was already compressed once. When that is fine, when to keep the original...