10/5/2017 - 7:58 AM

Download video from youtube and convert to mp3

Download video from youtube and convert to mp3

brew install youtube-dl

youtube-dl -f bestaudio  https://www.youtube.com/watch\?v\=DNceqb81wF0

It's outputs the Tony Anderson - The Way Home-DNceqb81wF0.webm

install ffmpeg on macos

brew install ffmpeg --with-libvpx

then start to convert

ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3

The -i option in the above command is simple: it is the path to the input file. The second option -f mp3 tells ffmpeg that the ouput is in mp3 format. The third option i.e -ab 192000 tells ffmpeg that we want the output to be encoded at 192Kbps and -vn tells ffmpeg that we dont want video. The last param is the name of the output file.

ffmpeg -i Tony\ Anderson\ -\ The\ Way\ Home-DNceqb81wF0.webm -f mp3 -ab 192300 -vn output.mp3