The Ultimate Guide to Downloading Any Video with yt-dlp and FFmpeg
Have you ever needed to download an online video for offline use, archival, or a project, only to be met with shady websites and low-quality rips? There's a better way. The combination of yt-dlp and FFmpeg is the definitive, open-source toolkit that gives you complete control over downloading video and audio from almost anywhere on the internet, including YouTube, TikTok, and Instagram.
This guide will walk you through setting up and using these two powerful command-line tools.
What are yt-dlp and FFmpeg?
yt-dlpis a powerful command-line program that can download video and audio from thousands of websites. It's a fork of the famousyoutube-dlwith additional features and more frequent updates.FFmpegis the swiss-army knife for video and audio processing.yt-dlpuses it to merge the high-quality video and audio streams that sites like YouTube serve separately. Without it, you might end up with a video file that has no sound.
Let's get them set up.
Part 1: Install yt-dlp (The Downloader)
First, we'll get the core downloader tool.
- Download the Executable: Go to the official yt-dlp GitHub releases page.
- Get the Right File: Scroll down to the "Assets" section and download
yt-dlp.exe. - Store It: Create a simple folder, like
C:\yt-dlp, and place theyt-dlp.exefile inside it. This keeps things organized. - Test It: Open Command Prompt (
Win + R, typecmd, press Enter) and run the following command to make sure it works.
C:\yt-dlp\yt-dlp.exe --version
If it prints a version number, you're good to go!
Part 2: Basic yt-dlp Commands
You can now download videos. Navigate to the folder where you want to save your files and run the commands from there.
Download a Single Video
This command grabs the best available version of a video.
C:\yt-dlp\yt-dlp.exe https://www.youtube.com/watch?v=VIDEO_ID
Download Audio Only (as MP3)
The -x flag extracts the audio.
C:\yt-dlp\yt-dlp.exe -x --audio-format mp3 <URL>
Download from TikTok or Instagram
It works for other sites too! Just use the video's URL.
# TikTok Example
C:\yt-dlp\yt-dlp.exe https://www.tiktok.com/@username/video/VIDEO_ID
# Instagram Reel Example
C:\yt-dlp\yt-dlp.exe https://www.instagram.com/reel/REEL_ID/
At this point, you might see a warning: ffmpeg or avconv not found. Please install one. This means yt-dlp downloaded the video and audio streams separately but couldn't merge them into a single high-quality file. Let's fix that.
Part 3: Install FFmpeg (The Merger)
This is the magic ingredient that makes everything work seamlessly.
- Download FFmpeg: Go to the official FFmpeg download page. Under the Windows icon, click the link for Gyan.dev.
- Get the Essentials: On the Gyan.dev page, scroll to the "release builds" section and download
ffmpeg-release-essentials.zip. - Extract and Store: Extract the ZIP file and place the resulting folder somewhere permanent, like
C:\ffmpeg. Inside, you'll find abinfolder containingffmpeg.exe. - Add FFmpeg to the System PATH: This crucial step lets you run
ffmpegfrom any folder in Command Prompt.- Press
Win + R, typesysdm.cpl, and hit Enter. - Go to the
Advancedtab and clickEnvironment Variables. - Under "System variables," find and select
Path, then clickEdit. - Click
Newand paste the path to yourbinfolder:C:\ffmpeg\bin. - Click
OKon all windows to save.
- Press
- Test It: Close and re-open Command Prompt, then run:
ffmpeg -version
If you see version information, your system can now find FFmpeg automatically.
Part 4: The Perfect Download Command
Now that both tools are installed, yt-dlp will automatically use FFmpeg to merge the best video and audio streams into a single file.
yt-dlp -f bestvideo+bestaudio <URL>
Pro Tip: Avoiding Codec Issues
Sometimes, the "best" video uses a new codec like AV1, which might not play on older TVs or software. To ensure maximum compatibility, you can tell yt-dlp to download the best version that uses the universal H.264 (AVC) codec.
This is the command I recommend for most uses:
yt-dlp -f "bv*[vcodec=avc1]+ba" --merge-output-format mp4 -o "%(title)s.%(ext)s" <URL>
Let's break that down:
-f "bv*[vcodec=avc1]+ba": Selects the best video (bv) with theavc1(H.264) codec, plus the best audio (ba).--merge-output-format mp4: Merges the final file into an MP4 container.-o "%(title)s.%(ext)s": Saves the file using its original title.
Part 5: Automate It with a Batch Script
Tired of typing that long command? Let's create a simple script to do it for you.
-
Create a Batch File: Open Notepad and paste the following code.
@echo off setlocal :: Ask for the video link set /p ytlink=Enter the video URL: :: Run yt-dlp with the recommended settings yt-dlp -f "bv*[vcodec=avc1]+ba" --merge-output-format mp4 -o "%%(title)s.%%(ext)s" %ytlink% echo. echo ✅ Download complete! pause -
Save It: Save the file as
download.batin the folder where you want your videos to go (e.g.,C:\MyVideos). -
Use It: Now, just double-click
download.bat, paste your video URL, and press Enter. The script will handle the rest.
Bonus: Convert an Existing Video to H.264
Already have an AV1 video that won't play on your TV? You can convert it without re-downloading using FFmpeg directly.
ffmpeg -i "input-video.mp4" -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 192k "output-video-h264.mp4"
This command re-encodes the video to H.264 while preserving great quality.
With yt-dlp and FFmpeg in your toolkit, you have a professional-grade system for archiving and managing online media. Happy downloading!


