Hacker News new | past | comments | ask | show | jobs | submit login

I also save audio from YT occasionally. I prefer to use this command however (to get the best quality audio):

    youtube-dl -f bestaudio[ext=m4a] <youtube ID>
PS: you can replace m4a with mp3 but that will induce trasnscoding and loss of quality. YT's AAC tracks are usually the highest bitrate ones so it's best to leave it as is.



I believe bestaudio[ext=m4a] should be wrapped in quotes.

>"bestaudio[ext=m4a]"

(First time I've ever used it but it wouldn't work for me without the quotes)


youtube-dl already defaults to downloading the best quality audio; you only need that line if you want to force a particular format.


Not quite. Sometimes "bestaudio" downloads webm files because Opus audio tracks report higher average variable bitrate. If you don't want to download video+audio and don't want to transcode or deal with Opus stuff, you need that m4a flag in there. Since nothing supports Opus and you need to transcode and remove video, webm seems like a losing proposition. And higher bit rate is deceptive since AAC is a much better encoder even at a lower bit rate.


That's what I mean: youtube-dl --extract-audio already downloads the best quality audio, which may be Opus (albeit typically via DASH rather than a full webm file), so you only need a line like the one you pasted if you want to specify a specific format such as m4a.


I thought youtube-dl defaults to "best"


youtube-dl defaults to "best"; youtube-dl --extract-audio defaults to "bestaudio".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: