Extract Audio from Video Files to WAV using Mplayer
published 2009-10-11 · tags: audio, mplayer, multimedia, video
AS PUBLISHED, 2009Original text from Oct 11, 2009, kept as published. Package names and flags reflect the tooling of that time; an in-place refresh with a tested on line is on the way.
You can extract the audio from a video file using mplayer and save the result to a WAV file, which you can then manipulate to your hearts content. For example, you may want to compress the audio to a stereo MP3 or OGG.
The following command instruct that the audio output (-ao) should be redirected out to a PCM WAV file as fast as possible, while suppressing all video output.
mplayer -ao pcm:fast:file=audio.wav -vo null -vc null video.avi
Convert the resulting WAV to MP3. The following is a great way to convert your WAV files to a high quality Variable Bitrate MP3. See the man page for a decent tutorial on the available options.
lame -V0 -q0 --vbr-new audio.wav audio.mp3