

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

Today, we will see how to download a portion of YouTube video with Youtube-dl and FFmpeg in Linux.īefore I know this tip, I would usually first download the entire video using Youtube-dl and then trim it down to my desired duration using FFmpeg as shown below. These two utilities are just enough to download videos from online and encode, decode, transcode, crop and mux the downloaded videos. Then download every single video with the same Audio/Video quality (if available): youtube-dl -f 135+140 PLk8DskRHO_0ZREMFQJAzaMJac66AKPZp_Īlternatively you can download just a video serie (ex.Even though there are multitude of programs available to download and encode videos, I prefer to use Youtube-dl and FFmpeg. Or just: youtube-dl -F PLk8DskRHO_0ZREMFQJAzaMJac66AKPZp_ The same option can be applied to a Playlist, first you can check some info youtube-dl -F You can easily download only the video or only the audio: youtube-dl -f 140 Hs0MnhokuPM Webm audio and video will be mixed together as Webm, anything else will be mixed as Mkv. They’re then automatically mixed together as Mp4 by ffmpeg. This will download a 480p video and the best m4a audio track. If you want a specific quality you can type: youtube-dl -f 135+140 Hs0MnhokuPM To download a video (it will automatically download the best audio/video quality): youtube-dl Hs0MnhokuPM There may be also some Webm video and audio but mp4 and m4a should always be there. Show the video information: youtube-dl -F Īt this point you’ll have different audio and video files, on the lest side are the format codes, I noticed that on Youtube they are always the same based on a specific format:ġ40 is always the best m4a quality audio track If so you’ll then need to update it manually: youtube-dl -U Sudo chmod a+rx /usr/local/bin/youtube-dl Or with this easy command (if your distro doesn’t have it): sudo curl -L -o /usr/local/bin/youtube-dl You can install it from your distro’s Repository (Arch in my case): # pacman -S youtube-dl This is the official website and GitHub page it mixes automatically different Video and Audio sources.It can download only the Audio or only the Video.Extremely easy to use yet it’s a very complete software.Youtube-dl is fast, lightweight, feature-rich and command-line-only video downloader.ĭon’t be scary for the lack of a GUI, it’s very easy to use even for terminal n00bs!
