Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

yt-dlp_linux -f bestaudio --audio-quality 2 --embed-thumbnail --add-metadata --extract-audio --audio-format mp3 --no-mtime -o "%(title)s.%(ext)s" http://



Yeah except do yourself a favor and don't use mp3


Unless you're getting them for older hardware that only plays mp3 like my car stereo...


Why, objectively?


1) MP3 is dated. Modern codecs give better quality at smaller filesizes.

2) Any lossy re-encoding step degrades quality. You'll get the highest quality by saving the stream direct from the server and skipping the re-encode step. Just pass --extract-audio and skip all those other arguments.


Can you give examples of modern codecs which are a better choice?


In this case since YouTube will provide it in Opus, Opus is the best choice, so that you're not re-encoding from lossy to lossy.


Here is one test where they compare some formats. Opus came out on top, even though for MP3, they allowed for a significantly larger bitrate. The downside is that the test is old, encoders evolve all the time, although this is true to both Opus and MP3.

http://listening-test.coresv.net/results.htm

The other kind of comparison to consider is transparency - the ability of a lossy codec to be indistinguishable from the uncompressed source. MP3 is supposed to achieve this at 192 kbps, while OPUS can do it in 128.

https://wiki.hydrogenaud.io/index.php?title=Transparency

The best choice, at the end of the day, is wholly dependent of the context of the usage. If all of the source is in MP3 to begin with, it doesn't make sense to convert.


YouTube natively provides audio in AAC which is higher quality per bitrate than MP3.

AAC has very wide support. Only convert AAC to MP3 if your player really doesn't support AAC.




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

Search: