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.