I'm using ffmpeg to encode an audio source to MP4 AAC using the switch -af volumedetect.(actually I convert it to PCM wav and pipe the output to NERO AAC, but it is not the point)

Works neat and yet gives me the volume analysis bellow so I can save time and CPU not having to run aacgain to analyse the AAC stream to find the volume.(Considering the source audio will be from a movie-kind length, so 2 hours+, which takes sooooooo long for aacgain to analyses and apply gain to it.)