RMS Normalize ffmpeg
<p>I’m new to ffmpeg and would like to create a script that can RMS normalize audio files to a specified RMS (mean) dB level. Can someone show how to do this? </p>

<p>I’ve used dynaudnorm, but can’t get the desired output, I believe it’s due it using frames opposed to analyzing the full file. </p>

<p>To RMS normalize, my thought is to use a conditional statement to create a filter that can automatically read RMS (mean) level of an audio file and then automatically set the RMS (mean) level to a specified dB level. </p>

<p>Theoretical example:</p>

<pre><code>ffmpeg -i (inputfilename) -af "normalize_rms=-20dB" (outputfilename)
</code></pre>

<p>Explanation of Conditional Statement and Example: </p>

<ul>
<li><p>Pass 1: run astats or volumedetect to calculate RMS level. </p></li>
<li><p>Pass 2: If RMS level = X dB, then add Y dB level to match the user specified dB level.<br>
Example:   If RMS level = -30dB, and user specified RMS level = -20dB, then add 10dB.</p></li>
</ul>