25
Extracting mp3 tracks from youtube videos [howto]

you all must be very familiar with downloading videos from youtube, and hence I shall not elaborate on it here. This post is about extracting .mp3 (the audio tracj) frommusic videos on youtube.com. So here goes…

step 1: first download the video from youtube using whatsoever means you would otherwise use.
step 2: download and install ffmpeg [windows version] from http://ffdshow.faireal.net/mirror/ffmpeg/
step 3: extract the audio track from the video bu running the following command
c:\> ffmpeg.exe -i Gaand_Mein_Danda.flv -ab 32k Gaand_Mein_danda.mp3
So, by specifying a command line switch “-ab 32k” the audio will be converted to a lower bitrate of 32kbit/s.
the output from executing the above command would be something like the following:

Seems that stream 1 comes from film source: 1000.00 (1000/1) -> 24.00 (24/1)
Input #0, flv, from ‘Gaand_Mein_danda.flv’: Duration: 00:04:27.4, start: 0.000000, bitrate: 64 kb/s Stream #0.0: Audio: mp3, 22050 Hz, mono, 64 kb/s Stream #0.1: Video: flv, yuv420p, 320×240, 24.00 fps®
Output #0, mp3, to ‘Gaand_Mein_danda.mp3′: Stream #0.0: Audio: mp3, 22050 Hz, mono, 32 kb/s
Stream mapping: Stream #0.0 -> #0.0
size= 1045kB time=267.6 bitrate= 32.0kbits/s
video:0kB audio:1045kB global headers:0kB muxing overhead 0.000000%

note the part highlighted in “bold”. The line in bold indicates that the output audio indeed was at a bitrate of 32kbit/s.

Some other things you can do are – changing the codec of the audio (-acodec option (find all codecs with -formats option)) or cut out a part of the audio (-t and -ss options) you are interested in.

This technique actually involved re-encoding the audio which was already in the movie file. If you read closely the audio option documentation, you will find that the -acodec option says:


`-acodec codec’ – Force audio codec to codec. Use the copy special value to specify that the raw codec data must be copied as is.

If the input video file was from YouTube or it already had mp3 audio stream, then using the following command line, the audio will be extracted much, much faster:

c:\> ffmpeg.exe -i Gaand_Mein_danda.flv -acodec copy Gaand_Mein_danda.mp3

Have fun ripping your favorite music off YouTube! :)


Comments
2
theozzfactor   # theozzfactor
  Posted 760 days ago. (hide)

gaand mein danda….lol….:-)) wht kinda song is tht? ;)

6
beachbong   # beachbong
  Posted 760 days ago. (hide)

@ozz – your wish is my command – http://www.indianpad.com/single/2815

5
rohanpinto   # rohanpinto
  Posted 760 days ago. (hide)

@theozzfactor – here u go ;)

1
rohanpinto   # rohanpinto
  Posted 760 days ago. (hide)

wow!! beach.. youre fast… !!

4
spencer_911   # spencer_911
  Posted 760 days ago. (hide)

Why you need to go through such a shangan mangan, when there are online tools available to do so

1
rohanpinto   # rohanpinto
  Posted 760 days ago. (hide)

well.. difference is buying beer vs making beer ;)

+ vixy does exactly the same thing…. on their servers… vs you doing it yourself on your desktop :-)

2
bollymms.com   # bollymms.com
  Posted 760 days ago. (hide)

haha funniest shit ever.. loved it

2
theozzfactor   # theozzfactor
  Posted 760 days ago. (hide)

hmm..thanks beach and rohan….how did i miss tht number? :-P

2
bollymms.com   # bollymms.com
  Posted 760 days ago. (hide)

@spencer what the hell is shangan mangan

Log in to comment or register here

Voters