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

Post a Comment

Your email is kept private. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>