[MPlayer-users] mencoder -audiofile uses different bitrate

Corey Hickey bugfood-ml at fatooh.org
Tue Nov 3 22:31:51 CET 2009


mencoder at perlmeister.com wrote:
> 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:

It's not really clear to me why mencoder is converting the audio to
s16le for '-oac pcm', but you can avoid that by just using '-oac copy'
instead.

-Corey


More information about the MPlayer-users mailing list