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

I like this command to extract audio from youtube videos:

    youtube-dl --extract-audio --audio-format mp3 <url>


If your music player supports OGG, you can also use youtube-dl -f FORMAT VIDEO_URL and give a numeric format that corresponds to a DASH webm audio-only stream, with vorbis audio (e.g. format 171 these days). The container is webm but it can be trivially changed to OGG with ffmpeg, which you can call via --exec automatically.

Edit: I mentioned that because you don't lose any quality reencoding.


That's my main use of youtube-dl for years now. I'm extracting audio from old french movies available on youtube, work a small sound extract with audacity and then post the result on soudcloud[1].

[1] A bit of self-promotion here, if you are interested this is my soundcloud playlist https://soundcloud.com/melicerte/sets/extraits-de-vieux-film...


That is a really cool playlist.


Why?


Why not!


I'm not against it or anything, I'm just wondering if it is a personal interest or if there is some niche usage I am unaware of.


I like to keep it in original audio format (usually AAC) instead of mp3, because with mp3 conversion, there is also some loss of quality due to re-compression.


Or you could use -x, which would only download the audio (because there's seperate audio and video streams on youtube).


yes -x is the same as --extract-audio, but I use an alias in my bashrc like this (if you don't use --audio-format mp3, you might not get mp3 (not necessarily a bad thing)):

    alias youtubemp3='youtube-dl --extract-audio --audio-format mp3'




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

Search: