Youtube to mp3

Like music from a youtube chan, and want to be able to play it offline, or on a mp3 player (e.g. in your car, etc) ?

Use youtube-dl and ffmpeg to achieve this.

Install ffmpeg

  • Download ffmpeg for windows
  • extract it to a known location :-)
  • Add it to your "path" for easy access

e.g. on Windows 10:

  • Open the Run window (right mouse click on Windows button, select "Open Command Prompt", type in sysdm.cpl and press enter

Run sysdm.cpl

  • On the next window go to the"Advanced"-tab and click "Environment Variables..." Advanced -> Environment Variables

  • In the lower end of the screen click on New and fill in the variable name e.g. "ffmpeg" and the location of the ffmpeg \bin folder (that we just downloaded) as variable value and click on OK to save

Create a new variable

  • Last thing we need to do is add it to our path variable. To do this scroll down to find the already existing, path variable and click Edit. In the new screen click the New button and add the newly created variable to the list e.g. %ffmpeg% which corresponds with the name we've chosen in the previous step. Add the new variable to the path variable

Now we can use the ffmpeg.exe command wherever we want.

Download & "install" youtube-dl on windows

  • Download youtube-dl (check this page for latest version) and save it somewhere you remember
  • Add that location to the path variable, same way as shown in the ffmpeg-installation above. To speed up things, you can also choose to put youtube-dl.exe in the bin folder of ffmpeg folder. This way it's automatically added to the PATH-variable, provided you executed the ffmpeg installation above.

Using youtube-dl to convert to mp3

Download your favorite youtube-audio track from any "Command Prompt" near you and execute youtube-dl by following this syntax:

youtube-dl -x --prefer-ffmpeg --audio-format mp3 <youtube-url>  

e.g. to download the mp3 version of Norah Jones - Don't Know Why
execute:

youtube-dl -x --prefer-ffmpeg --audio-format mp3 https://youtu.be/tO4dxvguQDk  

The file will be downloaded, converted to mp3 and saved to the current directory.

top