http://www.alper.net/ Eyup Alper Yoney

27Jun/112

The Linux Way of youtube to mp3

Few days ago, I found a new song in youtube and I've been listening it since then. I like to have it in my mp3 player but I couldn't find it in mp3 format. First, I thought to google it for tools or add-ons to convert from youtube video to mp3 but then I realized that it is actually quite easy with the shell. The necessary processes are already in place in my Linux.

1. youtube-dl, is a small command-line program to download videos from YouTube.com and a few more sites.
2. ffmpeg, is a complete, cross-platform solution to record, convert and stream audio and video.
3. lame, is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.

Here is the procedure;
First download the video with youtube-dl

$ youtube-dl "http://www.youtube.com/watch?v=QjA5faZF1A8"

then extract the audio from the video file with ffmpeg

$ ffmpeg -i QjA5faZF1A8.flv QjA5faZF1A8.wav

last, convert the wav file to mp3 with lame

$ lame QjA5faZF1A8.wav QjA5faZF1A8.mp3

Enjoy it :)

Comments (2) Trackbacks (0)
  1. And what is the name of the Song?

  2. Hi Alper,
    It is “Unuttun mu beni” from Sezen Aksu


Leave a comment

(required)

 

Trackbacks are disabled.