Hi - I'm emailing to ask for some professional assistance. I'm having trouble preforming an audio task in ffmpeg and am looking for someone with more expertise and programming experience than myself. I would like to use ffmpeg to RMS normalize audio files to a specified RMS (mean) dB level. My thought is to use a conditional statement to create an effect that can automatically read RMS (mean) level of an audio file and then automatically set the RMS (mean) level to a specified dB level. Theoretical example: ffmpeg -i (inputfilename) -af "normalize_rms=-20dB" (outputfilename) Explanation of Conditional Statement and Example: 1. run astats or volumedetect to calculate RMS level. 2. If RMS level = X dB, then add Y dB level to match the user specified dB level. Example: If RMS level = -30dB, and user specified RMS level = -20dB, then add 10dB. Please feel free to respond to stevecorrao@outlook.com is this project anyone is interested in developing. Best Regards, Steve
On 2016/04/17 1:43, Steve Corrao wrote:
1. run astats or volumedetect to calculate RMS level.
2. If RMS level = X dB, then add Y dB level to match the user specified dB level. Example: If RMS level = -30dB, and user specified RMS level = -20dB, then add 10dB.
If LUFS can be used instead of RMS, this could be achieved by a two step process. I could not find a tool off the shelf that measures RMS, However, to my understanding, LUFS/LKFS is now the standard method of normalizing audio for broadcast. 1. Measure LUFS using BS1770GAIN. http://bs1770gain.sourceforge.net/ 2. Transcode the source with FFmpeg with "--vol" option using values parsed earlier. -- David Shimamoto
On Mon, Apr 18, 2016 at 13:12:36 +0900, PSPunch wrote:
1. Measure LUFS using BS1770GAIN. http://bs1770gain.sourceforge.net/
ffmpeg's "ebur128" filter handles a subset of this, apparently. I'm sure it would appreciate some additional algorithms. Patch welcome. ;-)
2. Transcode the source with FFmpeg with "--vol" option using values parsed earlier.
I'm not aware of that option (ffmpeg doesn't even support double-dash options?), but you can use the "volume" audio filter: [...] -af volume="7.3 dB" [...] or something like that. And don't forget to avoid clipping, unless that doesn't matter to you. Moritz
On Mon, Apr 18, 2016 at 15:37:27 +0200, Moritz Barsnick wrote:
ffmpeg's "ebur128" filter handles a subset of this, apparently. I'm
Actually, reading bs1770gain's web page, I get the impression that ffmpeg's ebur128 filter covers it pretty exactly. Moritz
On 2016/04/18 22:37, Moritz Barsnick wrote:
ffmpeg's "ebur128" filter handles a subset of this, apparently. I'm sure it would appreciate some additional algorithms. Patch welcome. ;-)
(Again, to my understanding) the two standards on loudness monitoring "BS1770-rev3" and "EBU R128" point to the same standard. Just like "H.264" and "MPEG4-Part10" pointing to the same thing. It is nice to know that FFmpeg has EBU R128 already implemented as a filter. However, from what I read this filter is for analysis only, which makes since because the loudness is measured by parsing the entire program. To apply the appropriate gain according to analysis results, you will still need two passes, I think.
I'm not aware of that option (ffmpeg doesn't even support double-dash options?), but you can use the "volume" audio filter: [...] -af volume="7.3 dB" [...] or something like that.
This is my bad.. that was the option I use for the player side of my system... sorry :p -- David Shimamoto
Le primidi 1er floréal, an CCXXIV, PSPunch a écrit :
However, from what I read this filter is for analysis only, which makes since because the loudness is measured by parsing the entire program. To apply the appropriate gain according to analysis results, you will still need two passes, I think.
To adjust the loudness of the program by a constant amount, you need to know the loudness of the whole program, it is not an implementation limitation, anything else is logically impossible. Regards, -- Nicolas George
On Sat, 16 Apr 2016 16:43:01 +0000, Steve Corrao <stevecorrao@outlook.com> wrote:
Explanation of Conditional Statement and Example: 1. run astats or volumedetect to calculate RMS level. 2. If RMS level = X dB, then add Y dB level to match the user specified dB level. Example: If RMS level = -30dB, and user specified RMS level = -20dB, then add 10dB. Please feel free to respond to stevecorrao@outlook.com is this project anyone is interested in developing.
This seems to have some value. Tried it? ffmpeg -filters ... dynaudnorm A->A Dynamic Audio Normalizer. and so ... -af dynaudnorm Seems to set peaks ~ 0 and raises lower levels by 6dB etc
On Wed, Apr 20, 2016 at 10:57:26 +1000, Bazza wrote:
Explanation of Conditional Statement and Example: 1. run astats or volumedetect to calculate RMS level. 2. If RMS level = X dB, then add Y dB level to match the user specified dB level. Example: If RMS level = -30dB, and user specified RMS level = -20dB, then add 10dB. This seems to have some value. Tried it?
ffmpeg -filters ... dynaudnorm A->A Dynamic Audio Normalizer.
and so ... -af dynaudnorm Seems to set peaks ~ 0 and raises lower levels by 6dB etc
It appears to me that Steve wanted static normalization (i.e. a constant change of volume across the whole audio stream), not dynamic though. Moritz
On Wed, 20 Apr 2016 09:25:23 +0200, Moritz Barsnick <barsnick@gmx.net> wrote:
It appears to me that Steve wanted static normalization (i.e. a constant change of volume across the whole audio stream), not dynamic though.
Moritz
Yes. I appreciate your distinction but if he meant for the normalisation to occur across a set of videos it might be something to consider. It does seem to bring audio peaks to about -1 dB throughout a clip while retaining a reasonable dynamic range. I didn't check what happens at saturation level of an input file. Thanks Moritz.
participants (5)
-
Bazza -
Moritz Barsnick -
Nicolas George -
PSPunch -
Steve Corrao