Value In Brief – by Abanoub Hanna
All You Need To Know Explained In Brief

Convert Mp4 to Mp3 in Linux Terminal

Linux mac os x Tutorials

First things first, install the required software packages.

sudo apt-get install ffmpeg && sudo apt-get install libavcodec-extra-53

Then use it. For FFmpeg with Constant Bitrate Encoding (CBR)

ffmpeg -i video.mp4 -vn \
       -acodec libmp3lame -ac 2 -ab 160k -ar 48000 \
        audio.mp3

or if you want to use Variable Bitrate Encoding (VBR)

ffmpeg -i video.mp4 -vn \
       -acodec libmp3lame -ac 2 -qscale:a 4 -ar 48000 \
        audio.mp3

If it says ffmpeg is depricated use this command instead.

avconv -i video.mp4 -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 audio.mp3

The meaning of arguments

argvmeaning
-iinput file name
-vndisable video recording
-acodecforce audio codec to libmp3lame
-acset the number of audio channels
-arset the audio sampling frequency

I hope this helps.

« How to Create Bash Function ? Adding GIF image in an ImageView in android »