You can download a segment of a YouTube video using command-line tools or online services, but the method depends on what device you're using and whether you want to keep the file or just watch it offline once.
YouTube's terms of service prohibit downloading most videos without permission, even segments. That said, people download portions of videos for legitimate reasons — keeping a clip of your own uploaded content, saving educational excerpts for offline study, or archiving a live stream before it disappears. The tools exist; what matters is understanding what they do, what they cost you (usually your time or your data), and what the legal and technical limits actually are.
The most reliable method uses ffmpeg, a free command-line program that can trim a video during download rather than downloading the whole thing first. It works on Windows, Mac, and Linux. If you want to avoid the command line, online services like y2mate or SaveFrom.net let you paste a YouTube link and specify start and end times, though these sites are less stable and sometimes inject ads into the file. Mobile apps exist but are harder to recommend because YouTube actively blocks them and they disappear regularly.
Key Takeaways
- ffmpeg is the most reliable tool for downloading a specific segment; it requires typing commands but works consistently across devices.
- Online services like y2mate let you specify timestamps without installing software, but they're slower and less dependable than ffmpeg.
- YouTube livestreams disappear after broadcast unless archived, so downloading a segment is often the only way to keep it.
- Downloaded files are usually MP4 video or MP3 audio; the format depends on which tool you use and what quality you choose.
Using ffmpeg to download a segment from the command line
ffmpeg is a free program that runs on Windows, Mac, and Linux. It can download a YouTube video and trim it to a specific time range in one step, so you don't waste bandwidth downloading parts you don't need. You'll need to install it first, then use a second tool called yt-dlp (a maintained fork of youtube-dl) to handle YouTube's authentication.
Start by installing both tools. On Mac, use Homebrew: type brew install ffmpeg yt-dlp into Terminal. On Windows, download the ffmpeg executable from ffmpeg.org and add it to your system path, or use a package manager like Chocolatey. On Linux, most distributions have both in their package manager — apt install ffmpeg yt-dlp on Ubuntu or Debian.
Once installed, open Terminal (Mac or Linux) or Command Prompt (Windows) and navigate to the folder where you want the video saved. Copy the YouTube URL, then type a command like this:
yt-dlp --postprocessor-args "-ss 00:05:30 -to 00:12:45" "https://www.youtube.com/watch?v=VIDEO_ID"
Replace 00:05:30 with the start time (hours:minutes:seconds) and 00:12:45 with the end time. The video will download and ffmpeg will trim it automatically. The file saves as an MP4 in your current folder. This method is slower than streaming because it has to download the entire video first, then trim it — the time savings come from not storing the full file on disk.
Using online services for quick downloads without installation
If you don't want to install software, sites like y2mate.com, SaveFrom.net, and clipconverter.cc let you paste a YouTube link, choose a quality level, and specify start and end times in a web form. The site downloads the video and trims it, then gives you a download link. No installation, no command line.
The trade-off is reliability and speed. These services depend on YouTube not blocking them, which YouTube does regularly — a site that works today might be broken next week. They also tend to be slower than ffmpeg and sometimes inject ads or tracking code into the downloaded file. Some require you to solve a CAPTCHA or wait through a timer before the download starts.
To use one: go to the site, paste your YouTube URL into the input field, look for an option to trim or cut the video (not all sites have this), enter your start and end times, choose MP4 or MP3 format, and click download. The file will appear in your Downloads folder. Check it before deleting the original — some services occasionally corrupt the audio or video during conversion.
Downloading livestreams before they disappear
YouTube livestreams are deleted after broadcast unless the creator archives them. If you want to keep a segment of a live stream, you need to download it while it's happening or immediately after, before the creator decides whether to keep it. After a few days, most unarchived streams become inaccessible.
The same tools work for livestreams as for regular videos — yt-dlp can download a live stream while it's broadcasting. Open Terminal or Command Prompt and run the yt-dlp command with the livestream URL. The download will continue as long as the stream is live, and you can stop it whenever you want using Ctrl+C. If you want only a segment, trim it afterward using ffmpeg or an online service.
Some livestreams are geoblocked or require login. yt-dlp can handle login if you add the --username and --password flags, though this is less common for public streams. If a stream is private or deleted, neither tool will work — there's no way to recover it once YouTube removes it.
Understanding file formats and quality options
Downloaded YouTube videos come in a few formats. MP4 is the most common — it plays on almost any device and media player. MP3 is audio-only, useful if you're downloading music or a podcast. WebM is higher quality but less compatible. Most tools let you choose the quality before download: 1080p takes longer and uses more disk space than 720p or 480p, but looks sharper on larger screens.
YouTube encodes videos in different formats depending on what the uploader chose and what your device supports. yt-dlp and ffmpeg automatically pick the best available format, but you can specify one if you want. For example, adding -f best downloads the highest quality available, while -f worst downloads the smallest file. Most people should just use the default — it balances quality and file size reasonably well.
A typical 10-minute segment at 720p is 50 to 150 MB depending on how much motion and detail the video contains. A livestream of the same length might be larger because livestreams are often encoded at lower quality to handle variable bandwidth. Check your available disk space before downloading a long segment.
Why YouTube blocks downloads and what that means for you
YouTube's terms of service say you can't download videos unless YouTube explicitly allows it — usually through a "Download" button on the video page, which only appears for certain content. The restriction exists because most videos are copyrighted and YouTube has licensing agreements that don't include offline distribution. Downloading a copyrighted video without permission violates those agreements, even if you're the only person who ever watches it.
That said, YouTube doesn't actively pursue individual users who download videos for personal use. The enforcement happens at the platform level — YouTube blocks third-party download tools when it finds them, and it removes videos that violate copyright. If you download a segment of a video you don't own, you're technically breaking the terms of service, but you're unlikely to face legal consequences unless you share the file or use it commercially.
The safest approach: download only videos you created, educational content with explicit permission, or content in the public domain. If you're unsure whether a video is copyrighted, check the description or contact the creator. Many creators give permission to download and remix their work — they just don't advertise it because YouTube discourages the practice.
Troubleshooting common problems
If yt-dlp says "Video unavailable" or "This video is not available in your country," the video is either deleted, private, or geoblocked. There's no workaround for deleted or private videos. For geoblocked content, a VPN might help, but YouTube sometimes detects and blocks VPN traffic, and using a VPN to bypass geographic restrictions may violate the terms of service in your region.
If the download starts but stops partway through, your internet connection probably dropped. Restart the command and yt-dlp will resume from where it left off. If it keeps failing at the same point, try a lower quality setting using -f 18 (480p) instead of the default.
If the trimmed video has audio and video out of sync, the source file was encoded in a way that ffmpeg's trimming doesn't handle perfectly. Re-encode it using ffmpeg without trimming first: download the full video, then run ffmpeg -i input.mp4 -ss 00:05:30 -to 00:12:45 -c:v libx264 -c:a aac output.mp4. This takes longer but fixes sync issues.
Frequently Asked Questions
Is downloading a YouTube video illegal?
It depends on the video's copyright status and your jurisdiction. Most videos on YouTube are copyrighted, and downloading them without permission violates YouTube's terms of service and potentially copyright law. Downloading content you created, content explicitly marked as free to use, or public domain material is legal. When in doubt, ask the creator.
Can I download a segment without downloading the whole video first?
Not completely — the tools still have to download the entire video from YouTube's servers to extract the segment you want. What ffmpeg does is trim it before saving to your disk, so you don't store the full file locally. The bandwidth and time are the same either way.
Why does my downloaded video play in some apps but not others?
Different media players support different formats and codecs. MP4 files play almost everywhere, but if your file is WebM or uses an uncommon audio codec, some older devices or apps won't recognize it. Try opening it in VLC Media Player, which handles almost any format. If it plays there but not elsewhere, convert it to MP4 using ffmpeg.
Can I download a YouTube Shorts segment?
Yes, the same tools work for Shorts. yt-dlp treats a Shorts URL the same as a regular video URL. Shorts are usually 15 to 60 seconds, so the download is fast. The file will be vertical (portrait orientation) rather than landscape.
What happens if YouTube blocks the tool I'm using?
YouTube regularly updates its blocking, and tools like yt-dlp update in response. If a tool stops working, check whether a newer version is available — most tools release updates within days of being blocked. ffmpeg and yt-dlp are actively maintained, so they usually catch up quickly. Online services like y2mate go down more often and sometimes don't come back.