It appears that MP3 files can contain audio that is over-scale, or in other words, audio with an amplitude greater than 1x.
When transcoding such an MP3 file with FFmpeg, the output has severe hard clipping in the waveform. Using "-af volume" or "-af loudnorm" does not correct this problem, since these filters only operate on the output.
So my question is, how can I get FFmpeg to properly handle these MP3 files so that their audio doesn't get clipped? Is there a setting for the input that would allow for correcting the gain on these MP3 files?
Here's a screenshot of an over-scale file. If I import an over-scale type MP3 file into Audacity, it correctly handles it, and you can see that the waveform is above the 1x scale line.
And here's a screenshot of what FFmpeg does to that file if I transcode it to WAV format, using "-af volume=0.5". You can see that it did change the output level to half, but it still clipped the waveform, resulting in square waveform tops for anything that exceeds 1x amplitude in the source file.