You can also filter the video results by putting a condition in brackets, as in -f "best" (or -f If you want to download multiple videos and they don't have the same formats available, you can specify the order of preference using slashes, as in -f 22/17/18. You can get the list of available formats using -list-formats, you can also use a file extension (currently it supports aac, m4a, mp3, mp4, ogg, wav, webm) or the special names best, bestvideo, bestaudio and worst. ![]() The simplest case is requesting a specific format, for example -f 22. ![]() FORMAT SELECTIONīy default youtube-dl tries to download the best quality, but sometimes you may want to download other format. (For those thinking TL DR, just read the 4th paragraph, and you can use youtube-dl -x URL as it should download the best quality anyway :)Īlso youtube-dl -f bestaudio URL works in my experience! However with both these options most of the time you will need convert to MP3 using ffmpeg or similar - since you are already editing the file you can also tag it (use the old ID3 version for most device compatibility!). ![]() It is also worth noting other pieces out of man youtube-dl (a online copy can be found here): You can list the available format with youtube-dl -F Resulting in an m4a file or youtube-dl -f bestaudio -extract-audio -embed-thumbnail -add-metadata So, if quality and file size matter to you, you should avoid re-encoding and stay with Youtube's native music formats: youtube-dl -f bestaudio -embed-thumbnail -add-metadata The default is 5 and might be a better choice depending on the source quality. The -audio-quality 0 uses the highest encoding quality but can increase your file size unnecessarily. ![]() So your command could be: youtube-dl -f bestaudio -extract-audio -audio-format mp3 -audio-quality 0 audio-quality QUALITY Specify ffmpeg/avconv audio quality, insert a value between 0 (better) and 9 (worse) for VBR or a specific bitrate like 128K (default audio-format FORMAT Specify audio format: "best", "aac", "vorbis", "mp3", "m4a", "opus", or "wav" "best" by default From man youtube-dl: -x, -extract-audio Convert video files to audio-only files (requires ffmpeg or avconv and ffprobe or avprobe)
0 Comments
Leave a Reply. |