[FFmpeg-user] Audio encoding problem

Nicolas George nicolas.george at normalesup.org
Fri Aug 23 14:51:37 CEST 2013

Le sextidi 6 fructidor, an CCXXI, Mustafa Yavuz a écrit :
> bit_rate is another problem for me. Is not it sample_rate *
> bit_count_per_sample?

In the PCM case, it is, if the bit count includes all channels. But you
probably do not need to use a pocket calculator to notice that 11025×16×1 is
not 64000.

> Why do we need to adjust it in encoder?

For PCM, you do not need to. For lossy codecs, that propose a trade between
bit rate and quality, you may want to set it to encode at fixed bit rate.

> I need to resample it before encoding, but now I don't understand the
> functionality of sample_rate, channel number parameters in
> av_codec_context class, does not it resample it while encoding?

No, it does not resample for encoding. For PCM, sample rate will not make
any difference. The channel count will make a difference, because it will
tell how many values per sample there is, but the channel layout is

For other codecs, sample rate will make a difference: lossy codecs will use
frequency filters to eliminate noise that can not be heard by the human ear,
and this kind of noise does not look the same at 8000 Hz and at 48000 Hz.
And the channel layout may have an impact: there is not the same kind of
channel coupling between front and back than between left and right, and you
do not encode the sub-woofer channel the same way as the others.

> 2013/8/23 Nicolas George <nicolas.george at normalesup.org>

Please do not top-post on this mailing-list. If you do not know what it
means, look it up.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20130823/71dfb349/attachment.asc>

More information about the ffmpeg-user mailing list