
Here, we used -f best flag to download the best quality audio and video. If you don't want to download the entire video but only a part of it, you can combine ffmpeg and youtube-dl to download a specific portion of the youtube video like below: $ youtube-dl -external-downloader ffmpeg -external-downloader-args "-ss 00:01:00.00 -to 00:02:00.00" -f best "" If you want to keep both, simply pass the -k flag. After trimming the video to the given length, it will delete the original video and keep only the portion of the video. Please note that Youtube-dl will download the entire video before processing it. This will start encoding at 1 minute and take only the next 50 seconds. You can also use -t flag to specify the total time duration. So the above command will start encoding at 1 minute and end at 2 minutes. Here, -ss 00:01:00 is the starting time of video and -to 00:02:00 is the ending time. To download a portion of a video with Youtube-dl, run: $ youtube-dl -postprocessor-args "-ss 00:01:00 -to 00:02:00" "" Youtube-dl has the -postprocessor-args parameter to download a specific portion of a youtube video or videos from several other websites. If you haven't installed Youtube-dl on your Linux machine yet, refer the links attached in the first paragraph. This video is 2:43 minutes long and it basically demonstrates how to launch web browsers in full screen mode in Linux. Read on! Download A Portion Of Youtube Video with Youtube-dl And FFmpegįirst, we will see how to download a specific part of youtube video using Youtube-dl script.įor the purpose of this guide, I will be using this video from the official YouTube channel for our OSTechNix blog. I know slightly a better a way to download parts of youtube video instead of full video. If you still follow this method to download and trim videos, don't bother. This is what I was doing to get only a portion of video.

To download a video, I would do: $ youtube-dl Īnd then trim the downloaded video using starting and ending time of the video clip as per my liking with FFmpeg using command: $ ffmpeg -i input_video.mp4 -ss 00:01:00 -to 00:03:00 -c copy output_video.mp4
