Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: aacgain in dBs (Read 4424 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

aacgain in dBs

Hi!

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.)

[Parsed_volumedetect_0 @ 0000000000388040] n_samples: 5763072
[Parsed_volumedetect_0 @ 0000000000388040] mean_volume: -30.7 dB
[Parsed_volumedetect_0 @ 0000000000388040] max_volume: -6.2 dB
[Parsed_volumedetect_0 @ 0000000000388040] histogram_6db: 9
[Parsed_volumedetect_0 @ 0000000000388040] histogram_7db: 39
[Parsed_volumedetect_0 @ 0000000000388040] histogram_8db: 146
[Parsed_volumedetect_0 @ 0000000000388040] histogram_9db: 370
[Parsed_volumedetect_0 @ 0000000000388040] histogram_10db: 987
[Parsed_volumedetect_0 @ 0000000000388040] histogram_11db: 1907
[Parsed_volumedetect_0 @ 0000000000388040] histogram_12db: 3315


By doing some test I found that I have to apply this amount of gain to the encoded AAC file: 6.2 dB in order to get 89dB volume.

The problem comes up when I try to use aacgain.exe to apply those 6.2 dB to the AAC stream so it will be @ 89dB.

aacgain.exe /e encoded.mp4
Recommended "Track" dB change: 6.320000
Recommended "Track" mp4 gain change: 11
Max PCM sample at current gain: 3429.587245




From aacgain -h:
/g <i>  - apply gain i without doing any analysis

And finally: aacgain.exe /g 6.2

It does apply the gain but instead of 89dB it goes to 101dB!

Am I doing something wrong or this aacgain tool won't do the gain in dBs as expected?

aacgain in dBs

Reply #1
Even though I don't think you are obtaining what you think you obtain (i.e. max volume is not directly related to loudness), you are making a trivial mistake.


What is in here:  "-6.2" that isn't in here: "6.2".
Or what's the difference between 101 and 89? 12. What's 6+6? 12.

aacgain in dBs

Reply #2
Quote
What is in here: "-6.2" that isn't in here: "6.2".

Well its obvious I want a gain of 6.2dB and I'm not getting it by

aacgain.exe /g 6.2 encoded.mp4

Quote
Or what's the difference between 101 and 89? 12. What's 6+6? 12.

Coincidence my friend.
There is no correlation between those numbers ( I tested in others situations )

but thanks for answering


 

aacgain in dBs

Reply #4
Well its obvious I want a gain of 6.2dB and I'm not getting it by

Quote
The problem comes up when I try to use aacgain.exe to apply those 6.2 dB to the AAC stream so it will be @ 89dB.
It does apply the gain but instead of 89dB it goes to 101dB!


Well... It is obvious to me that you do NOT want a gain of 6.2 dB.
Quote
/g <i> - apply gain i without doing any analysis

A gain increases the volume.

Said that, I would like to know where did you get the 101dB value from. Scanning the modified file with aacgain? If so, what does it report previous to add the gain?


Coincidence my friend.
There is no correlation between those numbers ( I tested in others situations )


I know there is no correlation with the max_volume: -6.2 dB and the it goes to 101dB!. The question is what are you doing? (Other than using the wrong value)