[MPlayer-users] mencoder -audiofile uses different bitrate

mencoder at perlmeister.com mencoder at perlmeister.com
Tue Nov 3 17:31:32 CET 2009


How can I configure the bitrate/sample size of a PCM audio I want to add
to a video? Mencoder seems to default to

     AUDIO: 8000 Hz, 1 ch, s16le, 128.0 kbit

and for the life of me, I can't figure out how to get it to use

     AUDIO: 8000 Hz, 1 ch, u8, 64.0 kbit

instead. Okay, here's what I've done so far: I have an audio file,
sound.wav, which has the correct bitrate:

     $ mplayer sound.wav
     ...
     AUDIO: 8000 Hz, 1 ch, u8, 64.0 kbit/100.00%
     ...

And a have a video with no sound, nosound.avi:

     $ mplayer nosound.avi
     ...
     AVI: No audio stream found -> no sound.
     ...

Now, let's use mencoder to add the audio to the video:

     $ mencoder nosound.avi -oac pcm -ovc copy \
         -audiofile sound.wav -o withsound.avi
     ...
     Audio stream:  128.000 kbit/s  (16000 B/s)
     ...

See? Mencoder used 128kbits, although the audio file has 64kbits. And
the resulting .avi has 128kbits as well:

     $ mplayer withsound.avi
     ...
     AUDIO: 8000 Hz, 1 ch, s16le, 128.0 kbit/100.00%
       (ratio: 16000->16000)
     ...

Is there any way I can convince mencoder to use the bitrate/sample size
of the .wav file I've provided as input?

Thanks for any help ...

-- Mike

Mike Schilli


More information about the MPlayer-users mailing list