This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
R128GAIN is a FFmpeg and SoX based EBU R128 compliant loudness scanner. It helps you normalizing the loudness of your audio and video files to the same level.
|For playback see also:||http://in-ffsox.sourceforge.net/|
|2014-12-01||The new version of R128GAIN is called BS1770GAIN (no GUI yet):
Besides a clean-up there are some new features. Among them are
|2014-10-04||1.0.10||Made R128GAIN compatible with the latest FFmpeg (cf. changed FFmpeg ABI).|
Added an option to the command line (--tags=[rg|bwf])
and the GUI (drop down box) for letting R128GAIN write
instead of ReplayGain tags. The following BWF tags are currently supported
(depending on the format they may appear converted to upper case):
|2011-07-10||0.8.6||Allow choosing the BS.1770 block overlap by parameter partition (1, 2, 3, ...). The corresponding overlap in % is (1 - 1/partition) * 100%.|
|2011-05-15||0.8.5||Important: Requires "bumped" FFmpeg, i.e. "avformat-53.dll", "avcodec-53.dll", and "avutil-51.dll". For upgrading to the latest full FFmpeg build get the respective DDLs from calculates a XING header, i.e. MP3s processed with R128GAIN now contain the correct length information.|
R128GAIN supports a variety of configuration options:
This approach requires an appropriate playback system to make use of the information stored by the tags. Sometimes this is not desirable and the audio should be amplified or attenuated in order to comply with a certain standard. Following are two examples how to achieve this by means of the "command" feature.
Common to both examples
The following command uses SoX in order to apply the track gain in dB, i.e. to an audio file and writes the result to a WAV file
Audio and Video
The following command uses FFmpeg in order to apply the track gain using an appropriate audio filter to the (decoded) audio stream of a multimedia file and writes the result to a MKV file The video is verbatim copied by -vcodec copy, and the audio is encoded to FLAC by -acodec flac:
In order to make this work upgrading to full FFmpeg is recommended.
The Command Environment
TRACK: full path to the input file (including directory name and extension) NAME: name of the input file (excluding directory name, including extension) EXT: extension of the input file DN: output directory name (i.e. that's what you've entered in the "Output" field) RATE: sample rate of the input audio NCH: number of channels of the input audio BITS: bit depth of the (decoded) input audio TL: track loudness TLDB: track loudness in dB TG: track gain to apply in order to achieve compliance with a certain standards TGDB: track gain to apply in order to achieve compliance with a certain standards in dB TR: track loudness range TRDB: track loudness range in dB TP: track peak TPDB: track peak in dB AL: album loudness ALDB: album loudness in dB AG: album gain to apply in order to achieve compliance with a certain standards AGDB: album gain to apply in order to achieve compliance with a certain standards in dB AR: album loudness range ARDB: album loudness range in dB AP: album peak APDB: album peak in dB
$ r128gain --help An EBU R128 (http://tech.ebu.ch/loudness) compliant loudness scanner. For details refer to "http://r128gain.sourceforge.net/". Usage: r128gain [options] (file|directory)+ [-o <directory> [<format>]] Options: --r128 Run in EBU R128-2011 compliance mode (default). --r128-2011 Run in EBU R128-2011 compliance mode (default). --r128-2010 Run in EBU R128-2010 compliance mode. --a85 Run in ATSC A/85:2011 compliance mode. --a85-2011 Run in ATSC A/85:2011 compliance mode. --rg2 Run in ReplayGain2 compliance mode. --rg Run in ReplayGain compliance mode. --reference=<float> Set reference loudness in LUFS. --r128-compatible Calibrate output according to EBU R128. --rg-compatible Calibrate output according to ReplayGain. --db Use dB as unit rather then LU/TP. --partition=<int> BS.1770 overlap (overlap in % = (1 - 1/partition) * 100%, default: 4, i.e. 75% overlap). --gate=<float> BS.1770 gate (-10.0 .. -8.0, default: -10.0). --rg-calibration=<float> Aequivalent to use for ReplayGain loudness (default: -18.0). --no-peak Don't calculate the maximum peak. --sample-peak Calculate the maxium peak without up-sampling. --true-peak Calculate the maxium peak at 192 kHz (default). --range=on,--range Calculate loudness range (default). --range=off,--no range Don't calculate loudness range. --tags=[rg|bwf] Write ReplayGain (default) or BWF tags. --fast Switch off up-sampling and don't calculate loudness range. --mono=off Treat mono as stereo (default). --mono=on,--mono Don't treat mono as stereo. --quiet Supress output to stdout. --progress=on Display progress (default). --progress=off Don't display progress. --traditional Format output traditionally. --cpmod Copy access rights (experimental). --command=<string> Run command on each track. --overwrite Overwrite already existing output files. --in-place Overwrite original files (not recommended). --loglevel=<integer> Set FFmpeg loglevel. --regression Calculate linear regression between EBU R128 and ReplayGain. --duration Print out duration. --version Display version information. --ffmpeg=<path> Directory of the FFmpeg shared libraries. --sox=<path> Directory of the SoX shared libraries. --lame=<path> Directory of the Lame shared libraries. --magick=<path> Directory of the ImageMagick shared libraries. --help Display this information. Format: mkv Wrap into MKV container (recommended). flac Encode into FLAC (not recommend). lame [a=album|track|<int>] [q=<float>] Convert into MP3 and apply album (default) or track gain with quality (default: 2.0).
* download "r128gain-<ver>-src.tar.gz" * download "r128gain-<ver>-tools.tar.gz" * run: tar xfvz r128gain-<ver>-src.tar.gz tar xfvz r128gain-<ver>-tools.tar.gz cd r128gain-<ver> ./configure --bindir=/usr/local/bin --mode=full --gui=cli make make install * available configuration options (selection) --bindir: where to install the binaries --mode: if omitted, both versions, i.e. full and tiny, will be build * full: extended FFmpeg and lame * tiny: crippled FFmpeg and no lame --gui: if omitted, all GUIs possible will be build * cli: command line interface * gtk2: gtk2 gui (if gtk2 development packages are available) * gtk3: gtk3 gui (if gtk3 development packages are available) * win32: native win32 gui (on MS Windows only)
Results for the EBU R128 test vector:
Test cases for Loudness Metering (tech3341.pdf):
$ r128gain ~/ebu-loudness-test-setv03/*3341*.wav SoX sucessfully loaded. FFmpeg sucessfully loaded. analyzing ... [1/9] "seq-3341-1-16bit.wav": -23.0 LUFS (-0.0 LU) peak: -22.9 TPFS, range: 0.0 LU [2/9] "seq-3341-2-16bit.wav": -33.0 LUFS (10.0 LU) peak: -32.7 TPFS, range: 0.0 LU [3/9] "seq-3341-2011-8_seq-3342-6-24bit-v02.wav": -23.0 LUFS (0.0 LU) peak: -2.6 TPFS, range: 15.3 LU [4/9] "seq-3341-3-16bit-v02.wav": -23.0 LUFS (0.0 LU) peak: -23.0 TPFS, range: 13.0 LU [5/9] "seq-3341-4-16bit-v02.wav": -23.0 LUFS (0.0 LU) peak: -23.0 TPFS, range: 13.0 LU [6/9] "seq-3341-5-16bit-v02.wav": -23.0 LUFS (-0.0 LU) peak: -20.0 TPFS, range: 6.0 LU [7/9] "seq-3341-6-5channels-16bit.wav": -23.0 LUFS (0.0 LU) peak: -24.0 TPFS, range: 0.0 LU [8/9] "seq-3341-6-6channels-WAVEEX-16bit.wav": -23.0 LUFS (0.0 LU) peak: -24.0 TPFS, range: 0.0 LU [9/9] "seq-3341-7_seq-3342-5-24bit.wav": -23.0 LUFS (-0.0 LU) peak: -8.9 TPFS, range: 4.8 LU [ALBUM]: -23.2 LUFS (0.2 LU) peak: -2.6 TPFS, range: 15.6 LU done.
Test cases for Loudness Range (tech3342.pdf):
$ r128gain ~/ebu-loudness-test-setv03/*3342*.wav SoX sucessfully loaded. FFmpeg sucessfully loaded. analyzing ... [1/6] "seq-3341-2011-8_seq-3342-6-24bit-v02.wav": -23.0 LUFS (0.0 LU) peak: -2.6 TPFS, range: 15.3 LU [2/6] "seq-3341-7_seq-3342-5-24bit.wav": -23.0 LUFS (-0.0 LU) peak: -8.9 TPFS, range: 4.8 LU [3/6] "seq-3342-1-16bit.wav": -22.6 LUFS (-0.4 LU) peak: -20.0 TPFS, range: 10.0 LU [4/6] "seq-3342-2-16bit.wav": -16.8 LUFS (-6.2 LU) peak: -15.0 TPFS, range: 5.0 LU [5/6] "seq-3342-3-16bit.wav": -20.1 LUFS (-2.9 LU) peak: -20.0 TPFS, range: 20.0 LU [6/6] "seq-3342-4-16bit.wav": -24.5 LUFS (1.5 LU) peak: -20.0 TPFS, range: 15.0 LU [ALBUM]: -21.2 LUFS (-1.8 LU) peak: -2.6 TPFS, range: 16.5 LU done.
Soon a "Super Moderator" will show up with a random nonsense "answer" pushing you away (this particular nonsense doesn't even care about that the question is about video and that the HA forum hyped fb2000 is for audio only).
To get an idea about HA forum you might read "OK, I tried hydrogen audio. It didn't go too well" by wgscott:
My exchange with the "moderator" got worse. To his credit, he eventually apologized, but at that point I resigned, took my (now) dead dog avatar off, and logged out. I requested he delete the account.
What horrible, horrible people.
The one thing that does concern me is that these are guys going around wearing "Scientific" on their arm-bands. Scientists have enough of an image problem as it is. We don't need this. I would much rather hang with people who think USB cables sound different and music is described with words like "gooey" than those folks.
They aren't scientists.
They are anonymous keyboard bullies who slavishly ape what they wrongly perceive to be the aims and methodology of the natural sciences. It actually reminds me more of how things are done in the so-called social sciences (behavioral psychology and so on).
The "moderator" guy (and it almost certainly was a guy) clearly interpreted this as a "lack of respect". It takes a twisted perspective to see it that way, but clearly their self-imposed idiot-logical confines and bizarre rules and rigidity prevent them from seeing it any other way. The behavior is much more reminiscent of a religious cult. I spend almost all my time with scientists. My wife is one. Most of my friends are. None behave this way. Not one.
That is a fascist mentality, not a scientific one. A scientific one, ideally would be, "what is it that sounds different, and how can we test that?" or "how can I reproduce what you found in my system?" or something along those lines.