VBR encoding with ffmpeg native AAC codec

I installed ffmpeg v4 from the Ubuntu launchpad ppa:jonathonf/ffmpeg-4 repository but it does not have the libfdk_aac codec included :

$ ffmpeg -version | grep -i aac
$

EDIT 1: ffmpeg AAC encoders on my system :

$ ffmpeg -encoders | egrep -i "aac| ="
 V..... = Video
 A..... = Audio
 S..... = Subtitle
 .F.... = Frame-level multithreading
 ..S... = Slice-level multithreading
 ...X.. = Codec is experimental
 ....B. = Supports draw_horiz_band
 .....D = Supports direct rendering method 1
 A..... aac                  AAC (Advanced Audio Coding)
$

So, I have to use the ffmpeg native AAC codec.

I tried it with the -vbr argument with a value from 1 to 5, but the result bitrate does not change.

EDIT2 : I found the documentation of that encoder :

$ ffmpeg -hide_banner -h encoder=aac 
Encoder aac [AAC (Advanced Audio Coding)]:
    General capabilities: delay small 
    Threading capabilities: none
    Supported sample rates: 96000 88200 64000 48000 44100 32000 24000 22050 16000 12000 11025 8000 7350
    Supported sample formats: fltp
AAC encoder AVOptions:
  -aac_coder         <int>        E...A...... Coding algorithm (from 0 to 2) (default fast)
     anmr            0            E...A...... ANMR method
     twoloop         1            E...A...... Two loop searching method
     fast            2            E...A...... Default fast search
  -aac_ms            <boolean>    E...A...... Force M/S stereo coding (default auto)
  -aac_is            <boolean>    E...A...... Intensity stereo coding (default true)
  -aac_pns           <boolean>    E...A...... Perceptual noise substitution (default true)
  -aac_tns           <boolean>    E...A...... Temporal noise shaping (default true)
  -aac_ltp           <boolean>    E...A...... Long term prediction (default false)
  -aac_pred          <boolean>    E...A...... AAC-Main prediction (default false)
  -aac_pce           <boolean>    E...A...... Forces the use of PCEs (default false)

$

How can I do VBR AAC encoding with the native ffmpeg encoder ?


-vbr is a private option for the encoder libfdk_aac, so it's not available for the native FFmpeg AAC encoder.

According to FFmpeg Wiki: AAC

Variable bit rate (using -q:a):

ffmpeg -i input.wav -c:a aac -q:a 2 output.m4a

Effective range for -q:a is around 0.1-2. This VBR is experimental and likely to get even worse results than the CBR.

I didn't verify that wiki information.