Introduction

If you have a music video on your computer, and you want to extract the audio to put it on your cellphone, your mp3 player, your car stereo or any other place you want to hear the music in that video, you can use ffmpeg to extract the audio.

Please be sure to respect all copy rights before using this command.

How to extract audio mp3 from a video file

Maybe the most useful application for this tip, is to extract audio from youtube videos, first you will need to download the youtube video to your computer, there are lots of ways to do that, here I can give you one and two.

Once you have the .flv file in your computer, run:

ffmpeg -i csi-miami-intro.flv -ab 128 -ar 44100 csi-miami-intro.mp3

Now you have your mp3 file. The main options in that line are:

-ar freq Set the audio sampling frequency (default = 44100 Hz).

-ab bitrate Set the audio bitrate in bit/s (default = 64k).