enzo1982 / freac

The fre:ac audio converter project
https://www.freac.org/
GNU General Public License v2.0
1.43k stars 75 forks source link

Apple AAC CoreAudio Maximum bitrate is limited to 192kbps #467

Closed 57382 closed 1 year ago

57382 commented 1 year ago

This seems extremely unreasonable. You should not limit the freedom of users. You should not make decisions for the user. Even Apple CoreAudio encoder supports max 320kbps

57382 commented 1 year ago

IMHO. Such restrictions on encoders are stupid. At 256kbps I can get a full 24kHz spectrogram, which is beautiful. 256kbps is also Apple's official default encoder configuration.

drunkinlove commented 1 year ago

As far as I understand, freac lets you set "bitrate per channel". So for instance, when bitrate per channel is 192 kbps, the overall bitrate would be 384 kbps (maximum, since it seems to only do VBR). This checks out in MediaInfo.

meanwhile afconvert sets the overall bitrate:

    { -b | --bitrate } total_bit_rate_bps
         e.g. 256000 will give you roughly:
             for stereo source: 128000 bits per channel
             for 5.1 source: 51000 bits per channel
                 (the .1 channel consumes few bits and can be discounted in the
                 total bit rate calculation)
enzo1982 commented 1 year ago

As far as I understand, freac lets you set "bitrate per channel". So for instance, when bitrate per channel is 192 kbps, the overall bitrate would be 384 kbps (maximum, since it seems to only do VBR).

Exactly. The bitrate is per channel and thus fre:ac lets you actually set a higher bitrate than iTunes which only supports up to 160 kbps per channel.

Furthermore, the limit of 192 kbps per channel is imposed by the codec. fre:ac calls the AudioFormatGetProperty function with the kAudioFormatProperty_AvailableEncodeBitRates property ID to request the available bitrate range from the codec. It then limits the bitrate slider to that range.

In other words, fre:ac already lets you set the maximum AAC bitrate supported by the Core Audio codec.