I'm trying to download music from YouTube site using
youtube-dl with the best quality possible. So I've tried to download as a WAV file with this command:
youtube-dl -ci -f 'bestvideo[ext=mp4]+bestaudio' -x --audio-format wav https://www.youtube.com/watch?v=tDOffPd81YI
which produced a big WAV file (with this video, 42.3 Mo 48kHz stereo 16bit 1536kbit/s)
But when I compared with an M4A file, downloaded with:
youtube-dl -ci -f 'bestvideo[ext=mp4]+bestaudio' -x --audio-format m4a https://www.youtube.com/watch?v=tDOffPd81YI
The M4A file is smaller and lower quality (with this video, 12.3 Mo 48kHz stereo 441kbit/s).
Why is the WAV file better quality? And what causes the difference of file size? It is more strange that I have asked the same quality for both (
I tried downloading with
bestaudio quality and converting to a M4A file:
youtube-dl -ci -f "bestaudio" -x --audio-format m4a https://www.youtube.com/watch?v=tDOffPd81YI
On this file, I found that the first file had a bigger size and a bigger bitrate than the second, but it probably depends on the video you choose.
Does the flag
bestaudio[ext=m4a] download the
bestaudio stream in M4A format, or does it take the best audio and convert it to M4A?
I'm running on Manjaro Linux.