Answers.Body: <p>According to the wiki, you are likely to get worse results with the default AAC encoder when using VBR. See: <a href="https://trac.ffmpeg.org/wiki/Encode/AAC" rel="nofollow noreferrer">https://trac.ffmpeg.org/wiki/Encode/AAC</a></p>
  
  <p>One suggestion would be to use <code>libfdk_aac</code>. The other would be to demux the audio, re-encode it using a different encoder, and then remux that file back in to the video using ffmpeg. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-30T22:10:16.850Z
Answers.LastActivityDate: 2019-12-30T22:10:16.850Z
Answers.UserDisplayName: Mark Gulati
Body: <p>I tried encoding audio stream into AAC with a <em>variable</em> bitrate mode — I followed the advice from <a href="https://slhck.info/video/2017/02/24/vbr-settings.html" rel="nofollow noreferrer">FFmpeg VBR Settings</a> and changed my original option <code>-b:a 128k</code> to <code>-q:a 1.3</code> in this original command</p>
  
  <pre><code>ffmpeg -channel_layout stereo -i sc2.avs -b:a 128k -ar 24000 -ac 2 sc2.mp4
  </code></pre>
  
  <p>But I still obtained a <em>constant</em> audio bitrate.</p>
  
  <p>Output from MediaInfo:</p>
  
  <blockquote>
  <pre><code>Audio
  ID                                       : 2
  Format                                   : AAC LC
  Format/Info                              : Advanced Audio Codec Low Complexity
  Codec ID                                 : mp4a-40-2
  Duration                                 : 1 min 26 s
  Duration_LastFrame                       : -29 ms
  Bit rate mode                            : Constant
  Bit rate                                 : 119 kb/s
  Channel(s)                               : 2 channels
  Channel layout                           : L R
  Sampling rate                            : 24.0 kHz
  Frame rate                               : 23.438 FPS (1024 SPF)
  Compression mode                         : Lossy
  Stream size                              : 1.23 MiB (8%)
  Default                                  : Yes
  Alternate group                          : 1
  </code></pre>
  </blockquote>
  
  <p>The Any Video Converter (the old version 3.5.8), which internally uses FFmpeg, convert the same input into VBR mode:</p>
  
  <blockquote>
  <pre><code>Audio
  ID                                       : 2
  Format                                   : AAC LC
  Format/Info                              : Advanced Audio Codec Low Complexity
  Codec ID                                 : mp4a-40-2
  Duration                                 : 1 min 26 s
  Bit rate mode                            : Variable
  Bit rate                                 : 75.3 kb/s
  Maximum bit rate                         : 142 kb/s
  Channel(s)                               : 2 channels
  Channel layout                           : L R
  Sampling rate                            : 24.0 kHz
  Frame rate                               : 23.438 FPS (1024 SPF)
  Compression mode                         : Lossy
  Stream size                              : 778 KiB (9%)
  Language                                 : English
  Encoded date                             : UTC 2019-12-19 13:30:13
  Tagged date                              : UTC 2019-12-19 13:30:13
  </code></pre>
  </blockquote>
  
  <p>How to reach VBR audio output?</p>
  
  <p>(I need it because of <code>Dissolve()</code> function in AviSynth source file produces horrible sound for CBR, whereas it's nice for Any Video Converter's VBR audio output.)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-10-21T12:48:54.840Z
Comments.Text: Don't you need to specify which audio encoder to use? ie, `ffmpeg -channel_layout stereo -i sc2.avs -c:a aac -q:a 1.3 -ar 24000 -ac 2 sc2.mp4` If I do it I get variable bit rate audio
Comments.UserDisplayName: Danny
Tags: <ffmpeg><audio><framerate>
Title: Variable bitrate for AAC - how to reach it?
UserDisplayName: MarianD
ThreadText: # Variable bitrate for AAC - how to reach it?
  
  (Asked by: username_0 on 2019-12-19)
  
  I tried encoding audio stream into AAC with a *variable* bitrate mode — I followed the advice from [FFmpeg VBR Settings](https://slhck.info/video/2017/02/24/vbr-settings.html) and changed my original option `-b:a 128k` to `-q:a 1.3` in this original command
  
  ```
  ffmpeg -channel_layout stereo -i sc2.avs -b:a 128k -ar 24000 -ac 2 sc2.mp4
  
  ```
  
  But I still obtained a *constant* audio bitrate.
  
  Output from MediaInfo:
  
  > ```
  > Audio
  > ID                                       : 2
  > Format                                   : AAC LC
  > Format/Info                              : Advanced Audio Codec Low Complexity
  > Codec ID                                 : mp4a-40-2
  > Duration                                 : 1 min 26 s
  > Duration_LastFrame                       : -29 ms
  > Bit rate mode                            : Constant
  > Bit rate                                 : 119 kb/s
  > Channel(s)                               : 2 channels
  > Channel layout                           : L R
  > Sampling rate                            : 24.0 kHz
  > Frame rate                               : 23.438 FPS (1024 SPF)
  > Compression mode                         : Lossy
  > Stream size                              : 1.23 MiB (8%)
  > Default                                  : Yes
  > Alternate group                          : 1
  >
  > ```
  
  The Any Video Converter (the old version 3.5.8), which internally uses FFmpeg, convert the same input into VBR mode:
  
  > ```
  > Audio
  > ID                                       : 2
  > Format                                   : AAC LC
  > Format/Info                              : Advanced Audio Codec Low Complexity
  > Codec ID                                 : mp4a-40-2
  > Duration                                 : 1 min 26 s
  > Bit rate mode                            : Variable
  > Bit rate                                 : 75.3 kb/s
  > Maximum bit rate                         : 142 kb/s
  > Channel(s)                               : 2 channels
  > Channel layout                           : L R
  > Sampling rate                            : 24.0 kHz
  > Frame rate                               : 23.438 FPS (1024 SPF)
  > Compression mode                         : Lossy
  > Stream size                              : 778 KiB (9%)
  > Language                                 : English
  > Encoded date                             : UTC 2019-12-19 13:30:13
  > Tagged date                              : UTC 2019-12-19 13:30:13
  >
  > ```
  
  How to reach VBR audio output?
  
  (I need it because of `Dissolve()` function in AviSynth source file produces horrible sound for CBR, whereas it's nice for Any Video Converter's VBR audio output.)
  
  **Tags:** ffmpeg, audio, framerate
  
  > **Comments:**
  > **username_1**: Don't you need to specify which audio encoder to use? ie, `ffmpeg -channel_layout stereo -i sc2.avs -c:a aac -q:a 1.3 -ar 24000 -ac 2 sc2.mp4` If I do it I get variable bit rate audio  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-12-30. Score: 2
  
  According to the wiki, you are likely to get worse results with the default AAC encoder when using VBR. See: <https://trac.ffmpeg.org/wiki/Encode/AAC>
  
  One suggestion would be to use `libfdk_aac`. The other would be to demux the audio, re-encode it using a different encoder, and then remux that file back in to the video using ffmpeg.
  
  
  ---
  
  