Posted: . At: 11:57 PM. This was 11 years ago. Post ID: 5255
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to use mplayer to rip the sound from a video and create a wav file that you can encode with lame.

This is the command I just used to rip the audio from a movie and save it as a wav file. Then the lame command is used to encode the wav into an mp3 file.

john@adeptus-mechanicus ~/Music $ mplayer -ao pcm:fast:file=out.wav -vo null -vc null video.mp4 && lame -h -b 320 out.wav

This allows you to download a video from Youtube that has music you like and convert it into an mp3 file very easily. And you could use the oggenc command to encode the wav file into the ogg vorbis codec.

john@adeptus-mechanicus ~/Music $ oggenc out.wav --managed -b 128 -M 160 moviesound.ogg

Here I am using the lame command to encode the wav file into the mp3 format.

john@adeptus-mechanicus ~/Music $ lame -h -b 320 out.wav
LAME 3.99.5 64bits (http://lame.sf.net)
Using polyphase lowpass filter, transition band: 20323 Hz - 20903 Hz
Encoding out.wav to out.mp3
Encoding as 48 kHz j-stereo MPEG-1 Layer III (4.8x) 320 kbps qval=2
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA 
244544/244544(100%)|    6:38/    6:38|    6:40/    6:40|   14.716x|    0:00 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   kbps        LR    MS  %     long switch short %
  320.0        4.9  95.1        97.8   1.2   1.0
Writing LAME Tag...done
ReplayGain: -4.7dB

This is how you can convert a music video into an MP3 file. Very good to add music videos from Youtube to your portable player/phone. Linux does make this very easy. That is why the command line is so much more entertaining than using a GUI all of the time.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.