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.
Home: | http://r128gain.sourceforge.net/ | |
Project: | http://sourceforge.net/projects/r128gain/ | |
Download: | http://sourceforge.net/projects/r128gain/files/r128gain/1.0/ | |
For playback see also: | http://in-ffsox.sourceforge.net/ |
2020-01-17 | r128gain is still alive: it's now available on openSUSE! | |
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). |
2014-05-18 | 1.0.8 |
|
2014-03-30 | 1.0.6 |
|
2013-12-20 | 1.0.5 |
|
2013-12-18 | 1.0.4 |
|
2013-11-30 | 1.0.3 |
|
2013-11-18 | 1.0.2 |
|
2013-08-07 | 1.0.1 |
|
2013-07-14 | 1.0 |
|
2012-10-14 | 1.0-α-6 |
|
2012-08-17 | 1.0-α-4 |
|
2012-08-15 | 1.0-α-3 |
|
2012-05-27 | 1.0-α-2 |
|
2012-05-18 | 1.0-α-1 |
|
2012-04-06 | 0.9.7 |
Added an option to the command line (--tags=[rg|bwf])
and the GUI (drop down box) for letting R128GAIN write
BWF tags
instead of ReplayGain tags. The following BWF tags are currently supported
(depending on the format they may appear converted to upper case):
|
2012-03-18 | 0.9.6-3 |
|
2012-02-11 | 0.9.6 |
|
2012-02-07 | 0.9.5 |
|
2012-02-04 | 0.9.4 |
|
2012-01-06 | 0.9.3 |
|
2011-12-18 | 0.9.2 |
|
2011-12-09 | 0.9.1 |
|
2011-11-20 | 0.9 |
|
2011-10-08 | 0.8.8 |
|
2011-10-03 | 0.8.7 |
|
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
http://ffmpeg.zeranoe.com/builds/win32/shared/, orPlease note that FFmpeg's MP3 muxer (in "avformat-53.dll") now calculates a XING header, i.e. MP3s processed with R128GAIN now contain the correct length information. |
R128GAIN supports a variety of configuration options:
Further 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 at computeraudiophile.com:
Update 2018-06-29: | Just recently we checked the above links and found that computeraudiophile.com
have re-organized their forum and all links where broken. Hence we updated the links
and instead of quotes we introduced hard-copies.
BTW: These days, who knows what mentality fascists and NAZIs really had? Moreover, we have the impression that these days SJWs project all the evil they can imagine onto imaginary fascists and NAZIs just existing in their minds. |
---|