yt-dlp.app

Downloading

yt-dlp Download MP4: Force a Compatible Video File

Force yt-dlp to output a universally compatible MP4: merge into MP4, prefer H.264/AAC for maximum device support, or remux/recode existing downloads.

Updated 2026-06-13

yt-dlp often downloads WebM/MKV because those carry the highest-quality codecs. If you specifically need an MP4 (for editing software, TVs, phones), force it.

Merge into an MP4 container

yt-dlp --merge-output-format mp4 "<URL>"

Prefer MP4-friendly codecs (max compatibility)

For the broadest device support, prefer H.264 video and M4A/AAC audio:

yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]/b" --merge-output-format mp4 "<URL>"

Re-encode anything to MP4

If a source has no MP4-compatible streams, recode after download (slower, needs ffmpeg):

yt-dlp --recode-video mp4 "<URL>"

Remux without re-encoding when possible

yt-dlp --remux-video mp4 "<URL>"

--remux-video just repackages into MP4 when the codecs already allow it (fast, lossless); it falls back to copy where it can. For absolute maximum quality regardless of container, see download best quality.

Container conversions need ffmpeg. See the ffmpeg step in how to install yt-dlp on Windows.

Frequently asked questions

How do I force yt-dlp to download MP4?+
Add --merge-output-format mp4. For strict compatibility, also constrain the formats to mp4/m4a as shown above.
What's the difference between --remux-video and --recode-video?+
--remux-video repackages into MP4 without re-encoding when codecs allow (fast, lossless). --recode-video re-encodes (slower, some quality loss) but always produces MP4.
Why did I get a WebM instead of MP4?+
The best-quality streams were VP9/AV1/Opus, which live in WebM. Force MP4 with the commands above if you need it.

Related guides

Get the full power of yt-dlp — without the command line

Download the free desktop app for Windows, macOS and Linux. It installs everything for you and keeps its engine up to date automatically.