Preset audio bit rate control setting

Windows 10 Pro, 22H2
Shotcut 22.12.21 portable 64 bit

When saving export settings to a preset, Audio-Rate Control-Constant Bit Rate is not saved correctly to the preset. Average Bit Rate and Quality Based VBR are saved correctly, but Rate Control is set to Average Bit rate instead of Constant Bit Rate when the preset is loaded.

I see too that even though Rate Control is set to Constant Bit Rate, when hitting “OK” to save the preset, Rate Control will flip to Average Bit Rate in the export Audio tab GUI. It does not do this with Rate Control = Average BR or Quality Based VBR so something is flipping the setting on the action of saving the preset.

Hugo.

I reproduce this for default codec aac. As it turns out, the constant bitrate option does not work for anything other than libopus. Well, that is because most audio codecs do not offer both constant and average bitrate, or at least it is not obvious which do and how. The export advanced options do not embody a massive set of rules about what combinations of things are valid. Looking over this documentation page

https://trac.ffmpeg.org/wiki/Encode/AAC#NativeFFmpegAACEncoder

I supposed the real bug is that for aac there is no average bitrate but rather only constant. What about other codecs? Looks like libmp3lame for MP3 also defaults to constant and requires an additional option for average:

https://www.ffmpeg.org/ffmpeg-codecs.html#libmp3lame-1

I believe AC-3 is constant bitrate only, and Vorbis is average bitrate only.

It does not appear ffmpeg provides much common options here to control and differentiate, and for the most part it does not matter (outside of quality VBR, you get whichever the codec supports). We can use the libopus option vbr for all codecs to keep track of the UI state, and add proper support for ABR to MP3.

This is fixed for the next version.