Audacity 2.1.2 + FFMPEG 2.2.2 results in poor M4A quality.

Hi everyone,

I noticed after using Audacity 2.1.2 with the FFMPEG 2.2.2 binaries that exporting audio via the M4A(AAC) codec results in pretty lousy audio quality on the exported file, despite moving the slider all the way to the right (500). I had previously been using Audacity version 2.0.5 with FFMPEG version 0.6.2. I reverted back to 2.0.5 to make sure I wasn’t crazy and sure enough, there is a significant difference in audio quality when using FFMPEG 0.6.2 versus the 2.2.2 plugin. On the newer version the bit rate is always 191kbps on the exported file even if the source audio was higher, and there is a lot of distortion I can hear in the background of the audio. Does anyone have any clue as to why this is? Is it some sort of bug in the newer FFMPEG plugin? It was driving me nuts and I found myself needing to export in AC3 and then convert to M4A with a different program. I have since reverted back to Audacity 2.0.5 to regain the high M4A export quality. Thanks.

I doubt you want all the detail but the reasons for this situation are complex.

Please see the 2.1.2 Release Notes which state that the Quality slider does not work. Those notes give a workaround which is to set a constant bit rate by choosing “Custom FFmpeg Export” instead.

The reason the quality slider does not work is that the actual AAC encoder used has been changed from 2.0.6 onwards from FFmpeg’s own AAC encoder to the “libvo-aacenc” AAC encoder. Libvo-aacenc is constant bit rate, hence the variable bit rate Quality slider does not work. Libvo-aacenc also has a limitation that it is maximum two channels encoding.

We changed to the libvo-aacenc encoder despite its limitations because FFmpeg’s own AAC encoder (and another alternative “libfaac” encoder) do not work at all at lower sample rates. All the AAC encoders available to FFmpeg have problems as per https://trac.ffmpeg.org/wiki/Encode/AAC. The libfdk_aac encoder is said to have the highest quality per se, but by default it restricts maximum frequency in the exported file to 14000 Hz (below what you would expect from high bitrate MP3).

You can still use FFmpeg’s own native AAC encoder in 2.1.2 if you export using (external program). This works by typing out a text command in order to export. This allows you to choose variable bit rate (as you would choose with the old “Quality” slider) or constant bit rate. To specify the native AAC encoder you add “-strict experimental” to the text command. Example commands are at http://manual.audacityteam.org/o/man/exporting_to_an_external_program.html#ffmpeg.

Some people still use current Audacity and convert from WAV to AAC in iTunes. This uses Apple’s own proprietary encoder which is fast and usually thought to produce good results. See http://manual.audacityteam.org/o/man/tutorial_exporting_to_itunes.html#conversion.


Gale

Gale,

Thanks for the response. I like the approach of exporting to WAV and the converting in iTunes so I will do that.

Thanks again.