[MPlayer-users] using mencoder to extract audio

bwnospam-sf1 at yahoo.com bwnospam-sf1 at yahoo.com
Sat Nov 6 02:50:01 CET 2004


Sorry for reviving the dead horse but the advice given
wasn't exactly right.  See below.

My thanks to all who pointed out the way.  I've
incorporated this information into my project,  KMSnip
 (http://kmsnip.sourceforge.net) and invite all on
this list to try it out give comment, suggestion and
flames.

more below...

--- The Wanderer <inverseparadox at comcast.net> wrote:
> bwnospam-sf1 at yahoo.com wrote:
> 
> > Every time this has come up in the past it has
> been dismissed with
> > the suggestion to "use mplayer -dumpaudio".
> > 
> > "mplayer -dumpaudio" is a poor solution because it
> has to play the
> > entire selection and takes a lot more time than if
> you extracted it
> > with mencoder.
> 
> If you want to transcode the audio, rather than
> duplicating it exactly,
> then 'mplayer -ao pcm -vo null -vc dummy' is very
> fast and gives you a
> WAV file you can then pass to a separate audio
> encoder. (If you don't
> want to transcode it, then you may be out of luck -
> but your example
> snipped below attempted to transcode the audio,
> so...)
> 

Using -ao pcm only gives you a WAV file if the audio
stream in the input file wasn't compressed.  What -ao
pcm really gives you is the raw dump of the audio
stream bits without headers.  So if you want to create
an MP3,  first rip the video with mencoder using the
-oac mp3lame and then the <i>mplayer -ao pcm mplayer
-ao pcm -vo null -vc dummy -dumpaudio -dumpfile
fileout.mp3 filein.avi</i> will give you an mp3 file
without any tag which is perfectly legal since the
very first mp3 rips didn't include any metadata.  To
add metadata I used id3tag from the id3lib examples,
but others such as mp3tag from mp3blaster will also
work.

> > Before I set out to patch mencoder to properly
> handle the example
> > below, can someone who is more familiar with
> mencoder's options tell
> > me if there is another way to do this with the
> existing options?
> 
> There is not, and (unless my understanding of the
> design goals of
> MEncoder is significantly flawed) I seriously doubt
> that a patch to make
> it possible would be accepted. The reasons are
> below.
> 

Interesting.  My interpretation of the mencoder goals
was to "convert from any format recognized by mplayer
to any format recognized by mplayer".   mplayer does
recognize .mp3 files and plays them quite nicely. 
IMHO, this is a good thing if we are ever going to
have a comprehensive media player akin to what the
evil empire has.

  

> > It would seem to me that -novideo is dysfunctional
> in mencoder.  When
> > used it would ideally cause mencoder to no look
> for the video stream
> > and use an output container other than .avi  (mp3
> perhaps)
> 
> MEncoder is not an audio encoder, it's a video
> encoder. Audio encoding
> is secondary, and provided only because people
> rarely want to encode
> video without accompanying audio. You cannot use
> MEncoder to encode
> audio without video; 'mencoder -novideo' is
> nonsense.
> 
> Or, as the output from MEncoder puts it if the input
> file does not
> contain a video stream: "Video stream is mandatory!"
> 
> -- 
>        The Wanderer
> 
> Warning: Simply because I argue an issue does not
> mean I agree with any
> side of it.

I respect that. 






More information about the MPlayer-users mailing list