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! :)
home







