Created
October 5, 2017 07:58
-
-
Save andrejIka/a4fa94d155ab39ce9727b9199fbb116d to your computer and use it in GitHub Desktop.
Download video from youtube and convert to mp3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment