[FFmpeg-devel] [PATCH] doc/encoders: ffaacenc does not output CBR

Guillaume Khayat guillaume.kh.alt at gmail.com
Mon May 11 16:34:45 EEST 2020


The documentation and wiki imply the native AAC encoder can output CBR and VBR files :
>b
>Set bit rate in bits/s. Setting this automatically activates constant bit rate (CBR) mode. If this option is unspecified it is set to 128kbps.
>
>q
>Set quality for variable bit rate (VBR) mode. This option is valid only using the ffmpeg command-line tool. For library interface users, use global_quality.

Sources:
- https://ffmpeg.org/ffmpeg-all.html#Options-7
- https://trac.ffmpeg.org/wiki/Encode/AAC#NativeFFmpegAACEncoder

But testing the CBR mode gives out unexpected results
1. `ffmpeg -f lavfi -i sine=d=10 -c:a aac -b:a 128k out.m4a`
	=> outputs a variable bit rate file, with an average bitrate of 85kbps file, and a max bitrate of 128kbps
2. `ffmpeg -i someMusicMp3File -c:a aac -b:a 128k out.m4a`
	=> outputs a variable bit rate file, with an average bitrate of 122kbps file, and a max bitrate of 128kbps

I think the advertised "CBR" mode is instead a “constrained VBR” mode, where the provided bitrate is used as a target and/or a maximum allowed bitrate.

Signed-off-by: Guillaume Khayat <guillaume.kh.alt at gmail.com>
---
 doc/encoders.texi | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index aa3a6eeb66..44ff5e469b 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -30,17 +30,19 @@ follows.
 
 Advanced Audio Coding (AAC) encoder.
 
-This encoder is the default AAC encoder, natively implemented into FFmpeg.
+This encoder is the default AAC encoder, natively implemented into FFmpeg. It
+supports a constrained variable bit rate mode and a true variable bit (VBR)
+rate mode.
 
 @subsection Options
 
 @table @option
 @item b
-Set bit rate in bits/s. Setting this automatically activates constant bit rate
-(CBR) mode. If this option is unspecified it is set to 128kbps.
+Set maxmimum bit rate in bits/s. Setting this automatically activates constrained
+variable bit rate mode. If this option is unspecified it is set to 128kbps.
 
 @item q
-Set quality for variable bit rate (VBR) mode. This option is valid only using
+Set quality for true variable bit rate (VBR) mode. This option is valid only using
 the @command{ffmpeg} command-line tool. For library interface users, use
 @option{global_quality}.
 
-- 
2.24.2 (Apple Git-127)



More information about the ffmpeg-devel mailing list