Extract audio file from video file on Ubuntu

Preface

mencoder is a tool which can process video files. Sometimes, we just need the sound of a video, but we may only have a video file. At this time, we can use the mencoder to extract the audio file from the video file.

In this post, I will show you how to extract audio files from video files on Ubuntu Linux.

Main Body

First step, install the “mencoder”:

sudo apt-get install mencoder

Then, run the following command:

mencoder -oac mp3lame -ovc copy -of rawaudio {video file name.mp4/avi...} -o {audio file name.mp3}

It is worth noting that using the upper command will make the extract file “.mp3”. And then, if everything is OK, you just need to enter the “Enter” and wait for a moment.