FFmpeg AAC CBR

  • Is there a way using the Premiere / MediaEncoder plugin to use CBR AAC using the FFMpeg encoder? It seems to always produce VBR audio even if the video codec is set to CBR. For example, on one project the highest audio bitrate it will produce is 232Kb/s (according to FFmpeg -i) if you set it any higher than 192k.


    The issue is our master control has a QC check that requires the audio bitrate to be > 300Kb/s and if the metadata says anything less it will fail the asset right away.


    UPDATE:

    According to this, AAC by default (-v 0) will be CBR:

    http://wiki.hydrogenaud.io/ind…unhofer_FDK_AAC#Bandwidth


    Something else is going on here then… no matter what I set it to, any bitrate greater than 192Kb/s will result in the audio bitrate being 232Kb/s.


    According to ffmpeg -I:

    "Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 232 kb/s (default)"


    Any ideas?

  • So when I export like this ...


    pasted-from-clipboard.png


    .. I get:



    which should be okay, right?

    Stay up-to-date and follow me on Twitter. Tell me your feedback.


    Help to improve this plugin and support me on patreon. Thank you.

  • Interesting... so it is doing VBR.


    ID : 2

    Format : AAC LC

    Format/Info : Advanced Audio Codec Low Complexity

    Codec ID : mp4a-40-2

    Duration : 11 min 50 s

    Bit rate mode : Variable

    Bit rate : 233 kb/s

    Maximum bit rate : 320 kb/s

    Channel(s) : 2 channels

    Channel layout : L R

    Sampling rate : 48.0 kHz

    Frame rate : 46.875 FPS (1024 SPF)

    Compression mode : Lossy

    Stream size : 19.7 MiB (1%)

    Default : Yes

    Alternate group : 1


    I thought I could add custom parameters into the encoder dialog but I guess not. Is there somewhere else I can look to force it to do CBR?

  • Here's the log file:



    And it still did audio in VBR:



    Any ideas?

  • I tried beta4, and the same thing. However I did see something interesting. It appears that for bitrates 256Kb/s and up, it uses VBR however 192Kb/s and below it uses CBR.


    128k log:



    128k Media Info:


    192k log:


    192k Media Info:

    256k log:

    256k Media Info:

    Does that give any clues?

  • I'm currently using Voukoder R2 2.2 and I also tried to reproduce this behavior. In my case I can confirm that, if I choose a bitrate higher than 256 kb/s with stereo sound MediaInfo says it is VBR. When using 5.1 Mediainfo says VBR no matter which bitrate I choose. But I think this is not a Voukoder problem because with ffmpeg commandline this is the same.

  • It's almost like Ffmpeg tries to optimize and makes a decision, based on the source audio, whether or not VBR will more efficient and override your settings. As in, it's concludes that anything more than a certain amount for that audio will make no difference so goes with the method that's the lower of the two. This could explain why we are all seeing different numbers since we're using different test files. Ours are a lot of spoken word.


    Is there a way to use a different encoder (like Fraunhaufer) that will always do CBR? I saw in an earlier thread that was possible on the 1.x branch so wondering if it can be done on 2.2?


    I really want to use and support this plug in as it would really make our workflow much more efficient. Just need to figure out a solution for this audio bitrate since QC will only accept it if audio is 320k...

  • Great news! Using the fdk_aac for audio worked perfectly to create a 320Kb/s CBR. I sent the Voukoder-processed file to QC and it passed perfectly.


    This is a great plugin and will save us a lot of time!