Help us keep the list up to date and submit new video software here.

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoHD and convert all your movies to Blu-ray or HD Video. Free trial ! :)

Software Home »



BS1770GAIN (replaces R128GAIN) is a FFmpeg and SoX based ITU-R BS.1770 loudness measurement. It helps you normalizing the loudness of your audio and video files to the same level. This program is free software under GNU GPL. Command line software.

Free software
OS: Windows Linux
File size: 6.8MB
Beta version
Portable version
Old versions
Version history
1 vote
Rate it


BS1770GAIN screenshot
Click to enlarge screenshot
Latest version

0.5.2 / 0.6.0 Beta 16 (June 20, 2019)


Visit developer's site

Download BS1770GAIN 0.5.2 Windows  6.8MB  Win  Portable

Download BS1770GAIN 0.5.2 Windows 64-bit  6.9MB  Win64  Portable

Download BS1770GAIN 0.5.2 Linux  7.8MB  Linux

Download BS1770GAIN 0.5.2 Linux 64-bit  7.9MB  Linux64

Download Beta, Portable and other versions

Download BS1770GAIN 0.6.0 Beta 16 Portable Windows  6.9MB  Win  Portable

Download BS1770GAIN 0.6.0 Beta 16 Portable Windows 64-bit  7.4MB  Win64  Portable

Download BS1770GAIN 0.6.0 Beta 16 Linux  8.3MB  Linux

Download old versions

Download BS1770GAIN old versions

Software License

Free software / FOSS (Free download and also Free and Open Source Software)

Supported operating systems

WinWindows LinuxLinux

More information and other downloads

Complete Version history / Release notes / Changelog

2019-06-24 0.6.0-β14 through 0.6.0-β16
Adriano pointed us to a sever bug when processing WAV files (cf. AVCodecContext::channel_layout 0 for WAV files.)
Adriano proposed that there shoud be a means for suppressing results up the hierarchy. That's why there's a --suppress-hierarchy option.
Kyle (from South Korea) pointed us to an issue with files where FFmpeg is unable to extract a duration.
Thanks a lot Adriano and Kyle!

2019-06-14 0.6.0-β13
When transcoding/remuxing bs1770gain v0.6.0-&#946;13 first creates a temporary file before finally moving it to it's destination. By default, the temporary file's name is the target file's name prefixed with a dot ‘.’. When it happens that there is a file in the way with that particular name bs1770gain aborts. In order to make it possible to resolve this (we assume very rare) situation bs1770gain offers an option --temp-prefix=<prefix> making it possible to define a prefix different from the default.

2019-06-12 0.6.0-&#946;12
Dealing with option --overwrite still wasn't in the shape it should be.

2019-06-11 0.6.0-&#946;10
Fixed crashing with option --overwrite.

2019-06-11 0.6.0-&#946;9
Diimaan pointed us to a severe bug when re-muxing without transcoding, i.e. using option -o without option -a. Thanks a lot Diimaan!

2019-06-10 0.6.0-&#946;4 trough 0.6.0-&#946;8
Jointly with Alexis made bs1770gain compilable on macOS (i.e. with gcc 10.0.1 whereas on our site just gcc 6.3.0 or gcc 9.1.0 is available.) Thanks a lot Alexis!

2019-06-10 0.6.0-&#946;3
This &#946;-release should fix the following:
Alexis reported that attempting to build on macOS aborts with a compilation error. Thanks a lot Alexis!
Diimaan reported an issue with loading the shared FFmpeg objects. Thanks a lot Diimaan!

2019-06-06 0.6.0-&#946;2
Fixes a bug with re-muxing to an unexpected target path when the source path contains one ore more additional dots ‘.’ except the separator for the file extension. Thanks a lot Hadrien for testing!

2019-06-06 0.6.0-&#946;1
This &#946;-version is the first attempt letting see a renovated bs1770gain the light of the world:
SoX is history. Prior versions of bs1770gain relied on libsox for re-sampling. This version does re-sampling by means of ffmpeg's libswresample.
The renovation's major goal was getting rid of libsox. While at it we invented new data structures better fitting the problem domain. Finally we ended up replacing the libffsox and the bs1770gain layers by respective libff and libbg layers.
The responsibility of the libff layer is providing building blocks for accessing the ffmpeg libraries, i.e.
libavfilter (not needed by prior versions),
libpostproc (not needed by prior versions),
libswresample (not needed by prior versions),
libavcodec, and
For re-muxing in conjunction with transcoding the audio stream (by means of the -a/--apply option) bs1770gain now relies on libavfilter which in turn needs libpostproc.
The responsibility of the libbg layer is on one hand accessing the ffmpeg libraries (via the libff layer) and on the other hand accessing the lib1770 layer implementing the BS.1770 algorithm (which mainly has been untouched except fixing a minor bug preventing aggregation up the hierarchie.)
A great deal of time was spend improving the UTF-8 capabilities (especially for the Windows version. Please note that we've tried hard to find a solution for the cmd-box which is not UTF-8 aware at all wheras the MSYS2 shell indeed is - bs1770gain decides whether run from cmd-box or shell by examining the LANG environment variable and respectively relies on a 8 bit OEM or UTF-8 character representation when writing to cmd-box or shell. To make things worse a 16 bit wide character representaion is needed when writing to a file ... Note: We've tested with some cyrillic alphabet completely outside the lower half of the ASCII table - The best we could achieve with the cmd-box on our system is producing question marks - German OEM page is not able to display cyrillic letters - for you guys over there in Russia hopefully everything is fine except you have german umlauts in your file names ...)

2019-01-23 0.5.2
Released in order to make it into Debian 10 'buster'. Essentially the same as v0.5.2-&#946;3.

2019-01-23 0.5.2-&#946;3
By the previous &#946;-release we fixed a bug w.r.t. the MP3 codec we've already fixed by v0.5.0-&#946;2 w.r.t. the OPUS codec. This &#946;-release generalizes the approach.

2019-01-23 0.5.2-&#946;2
Aimed to fix bug #910451.

2018-10-26 0.5.2-&#946;1
User Hadrien wrote "I've found that bs1770gain wasn't liking ''s in dirnames" and provided a patch this &#946;-release incorporates.
Again modified slightly the build process.

2018-10-19 0.5.1
Brought back to life building the project with autotools.

2018-09-02 0.5.0
Essentialy the same as v0.5.0-&#946;5.

2018-08-11 0.5.0-&#946;5
Remuxing files with more then one stream (i.e. video files) was broken. This &#946;-release fixes the issue.

2018-08-09 0.5.0-&#946;4
With v0.5.0-&#946;1 we introduced guarding bs1770gain against being run with incompatible FFmpeg and SoX libraries. At least this was the goal. In case of the FFmpeg libraries the test was done against the full version consiting of major, minor, and micro version numbers. This was by far to much. As far as we know just a bump of the major version number indicates some change in binary compatibility. This release relexas the test to FFmpeg major version number.

2018-08-05 0.5.0-&#946;3
User Martin reported that the Windows build of prior versions is broken in that it comes up with a message like

Hence this release is of interest just for Windows users in that it fixes the issue.
Many thanks, Martin!

2018-08-02 0.5.0-&#946;2
User Michal reported that bs1770gain v0.5.0-&#946;1 is crashing when run with Opus samples.
As cause we could identify that (deprecated) avcodec_decode_audio4() crashes when flushed with AV_CODEC_ID_OPUS.
As a workaround flushing the decoder is avoided now for AV_CODEC_ID_OPUS.
There's nothing preventing us from replacing deprectated API avcodec_decode_audio4() by the contemporary replacement API avcodec_send_packet()/avcodec_receive_frame (as already announced for several times. Of course, it's easier said then done ...)
Thanks again Michal!

2018-07-29 0.5.0-&#946;1
Essentially this is a re-compilation against current FFmpeg. As it turned out bs100gain was showing unexpected behaviour when run with current (incompatible) FFmpeg libraries.
While at it we guarded bs170gain against being run with incompatible FFmpeg and SoX libraries.
Fixed some bugs:
#881131: The bug was forced due to artifical test data faking zero channels:
peter@debian-9-32:~/msys64/bs1770gain$ ~/bs1770gain/bin/bs1770gain ./bug-881131-channel-underflow/poc -o output
analyzing ...
[1/1] "poc": Error channel underflow (0 - should be 1 at min): ffsox_frame_reader_create() - "ffsox_frame_reader.c" (55).
Error creating frame reader: ffsox_frame_reader_new() - "ffsox_frame_reader.c" (132).
Error creating frame reader: ffsox_analyze() - "ffsox_analyze.c" (68).
Error gathering track statistics - "bs1770gain_tree.c" (152).
peter@debian-9-32:~/msys64/bs1770gain$ _
#881132: The bug was forced due to artifical test data faking a number of channels by far greater then the numer supported by FFmpeg:
peter@debian-9-32:~/msys64/bs1770gain$ ~/bs1770gain/bin/bs1770gain ./bug-881132-channel-overflow/poc -o output
analyzing ...
[1/1] "poc": Error channel overflow (31 - should be 8 at max): ffsox_frame_reader_create() - "ffsox_frame_reader.c" (63).
Error creating frame reader: ffsox_frame_reader_new() - "ffsox_frame_reader.c" (132).
Error creating frame reader: ffsox_analyze() - "ffsox_analyze.c" (68).
Error gathering track statistics - "bs1770gain_tree.c" (152).
peter@debian-9-32:~/msys64/bs1770gain$ _
#883198: The bug was forced due to artifical test data fooling FFmpeg to come up with a zero codec id:
peter@debian-9-32:~/msys64/bs1770gain$ ~/bs1770gain/bin/bs1770gain ./bug-883198-missing-codec-id/poc -o output
analyzing ...
[1/1] "poc": Error finding decoder: ffsox_frame_reader_create() - "ffsox_frame_reader.c" (48).
Error creating frame reader: ffsox_frame_reader_new() - "ffsox_frame_reader.c" (132).
Error creating frame reader: ffsox_analyze() - "ffsox_analyze.c" (68).
Error gathering track statistics - "bs1770gain_tree.c" (152).
peter@debian-9-32:~/msys64/bs1770gain$ _
Re-designed the dynamic loader module ("ffsox_dynload.c" vs. "ffsox_dynload2.c").

2016-12-08 0.4.12
Added UTF-16 support to the Windows Console. Linux should not be affected and should have been worked all the time because being based on UTF-8. This development was triggered by Seongkyun (Andrei) Kim who is located in Korea and provided some testing.

2016-08-13 0.4.11
Just recently a very talented guy who calls himself kevinlekiller ( approached me with a bunch of bugs he obviously had learned the hard way by using the tool (i.e. by not artificially testing it). But not just that, he also proposed a solution for each of the bugs: This release mainly consists of his contributions.
Fixed ignoring the --audio=<n> option.
Fixed crashing with files containing more than 5 audio streams.

2016-07-18 0.4.10
Fixed writing xml escaped strings with the --xml option. Please note that bs1770gain is not officially supported on OSX even if it seems to build on OSX platforms and that it hence don't take into account unicode mapping anomalies between OSX and Linux/Windows (NFD/NFC). It will always output the unicode dialect common on the platform and hence the generated XML is not portable between OSX and Linux/Windows.

2016-03-16 0.4.9
In "ffsox_frame_convert.c", replaced constant ~0ll by ~0ull (sould fix #811955).
Replaced av_free_packet() by av_packet_unref() (should fix #810563).

2015-12-19 0.4.8
There's a new option --norm=<float> allowing to set the reference loudness to some value apart from -23.0 (EBU R128), -24.0 (ATSC A/85), or -18.0 (ReplayGain 2.0).
Loudness values are written to the output console with two places after the decimal point.
Regarding the Windows version, added some support for unicode paths (i.e. non-OEM).

2015-09-15 0.4.7
Fixed a serious bug regarding the -r option.

2015-09-12 0.4.6
There's a new option "--xml" for producing XML-output.
There's a new option "--stereo". The effect is that down-mix to stereo only happens if requested. The old version always silently down-mixes to stereo which is fixed now.
FFmpeg has bumped their version numbers, i.e is not binary compatible to the old version. The new binary release now requires avutil-55, swresample-2, avcodec-57, and avformat-57.

2015-06-25 0.4.5
Various fixes mainly to make BS1770GAIN compile on various architectures.

2015-06-22 0.4.4
Fixed "stuttering" videos.
Thanks to Petter Reinholdtsen there is now an official BS1770GAIN package available on Debian. Read about Petter's plans regarding BS1770GAIN.

2015-06-15 0.4.3
Automake/Autoconf compatible source code distribution.
Several fixes.

2015-06-08 0.4.2
Fixed memory leaks.

2015-01-29 0.4.1
Several fixes.

2015-01-14 0.4.0
Integrated BS.1770 analysis into the finite state machine.
Added automatic TRACK and DISC tags extension.
Added --extension <extension> option.
Several fixes.

2015-01-08 0.3.2
Added another extension.
Several fixes.

2014-12-30 0.3.1
Minor fixes.

2014-12-23 0.3.0
Finite state machine for remuxing/transcoding.

2014-12-11 0.2.1
Fixed a critical bug breaking the whole program (thanks to Michal Šmucr).
Improved diagnostic of erroneous command line.

2014-12-07 0.2.0
Added experimental options.

2014-12-04 0.1.1
Compiled with -O2.
Slightly different error handling with getopt_long().
Added the FFmpeg and SoX shared objects / dynamic link libraries to the release.

2014-12-01 0.1.0
Initial release.

2014-10-04 1.0.10
Made R128GAIN compatible with the latest FFmpeg (cf. changed FFmpeg ABI).

2014-05-18 1.0.8
Configuration files "wingui.ini" and "gtkgui.ini", respectively, per user (i.e. not global any longer).
Note: You have to reconfigure the application because the old configuration is lost.
Dynamically link to "swresample-0.dll" which is nowadays needed by "avcodec-55.dll".

2014-03-30 1.0.6
Reimplemented remuxing according to the respective FFmpeg example.

2013-12-20 1.0.5
Fixed a subtle yet setious bug letting R128GAIN crash under certain circumstances.
Reverted back to avutil-52 (i.e. being compatible with Zeranoe's FFmpeg builds again).

2013-12-18 1.0.4
Support for multiple frames in a FFmpeg packet.
Support for bumped avutil-53 (instead of avutil-52 as before).
Added a "Building from Scratch" section to the documentation.

2013-11-30 1.0.3
Added a command option preset supporting applying the gain to video files.
Removed a restriction with respect to editing the command option on the native Windows GUI.
Added a section on how to apply the gain by using the command option to the documentation.
Added "Why You Won't Post at Hydrogenaudio Forum" to the documentation.

2013-11-18 1.0.2
Adapt build process to latest FFmpeg.
SoX with FLAC 1.3.0.
SoX with WavPack 4.70.0.
Fixed "Failed opening 'r128gain-tools/'" bug on Linux.

2013-08-07 1.0.1
AVFMT_FLAG_GENPTS by default brings back smooth conversion to MKV for various broken VOBs.
Minor fixes.
No support via HA forum any longer.

2013-07-14 1.0
Various fixes and improvements.

2012-10-14 1.0-&#945;-6
Added ATSC A/85 support.
Added ReplayGain2 support.
Added an option "--reference" in order to define the reference loudness (EBU R128: -23 LUFS).
Added an option "--db" in order to force dB as unit instead of LU/TP.
Added an option "--quiet" in order to suppress any writing to stdout.
Fixed loading "".
Fixed overwriting of files.

2012-08-17 1.0-&#945;-4
The core library "lib1770" was restructured in order to avoid duplicated computations. Scanning the EBU R128 test vector demonstrates that there is performance boost of about 40% (without true peak computation).
The new "lib1770" now supports parallel computations. As demonstrated by the multithreaded "example2" program compared to sequential "example1" program parallelism may give another performance boost of about 50% (not yet used by R128GAIN).

2012-08-15 1.0-&#945;-3
Added "--ffmpeg" and "--sox" command line options in order to allow for providing the path to the respective shared libraries.
Fixed missing the "TP", "TPDB", "AP", and "APDB" environment variables.

2012-05-27 1.0-&#945;-2
Added a CLI (command line) only version (i.e. without GUI.)
Provided Linux 64 bit builds.
Fixed crashing CLI on Windows XP.

2012-05-18 1.0-&#945;-1
Unicode/UTF16 support for Win32.
GTK2 and GTK3 GUIs for Linux.
GTK2 GUI for Win32.
No static buffers any longer.
75% rewrite (BS.1770 algorithm unchanged).

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
Fixes a bug that under certain circumstances a file was written twice.
Upgraded to SoX 14.4.0.

2012-02-11 0.9.6
According to FFmpeg development has gone into OVERDRIVE. As a consequence R128GAIN wasn't compiling any longer using the latest FFmpeg versions. This release ports R128GAIN to the latest FFmpeg API.
Added a command line and GUI option to allow choosing between the EBU R128-2 (current, dating from 2011) and EBU R128-1 (former, dating from 2010) standards.
The release requires "avformat-54.dll" and "avcodec-54.dll", and is now again in line with the latest FFmpeg builds from

2012-02-07 0.9.5
Fixed a bug in 0.9.4 that only either the loudness or the loudness range could be computed but not both together.

2012-02-04 0.9.4
Implemented the EBU R128 loudness range (LRA) algorithm (not available for the ReplayGain and BS.1770 sequence algorithms.)
Provided four respective environment variables for the command option:
%TR%: The track loudness range.
%TRDB%: The track loudness range in dB/LU.
%AR%: The album loudness range.
%ARDB%: The album loudness range in dB/LU.
The API of LIB1770 (implementing the loudness range algorithm) has slightly changed in order to allow for providing the length of a block (either 400 ms or 3000 ms.)

2012-01-06 0.9.3
Provided four more environment variables for the command option:

%TL%: The track loudness relative to full scale.
%TLDB%: The track loudness relative to full scale in dB/LUFS.
%AL%: The album loudness relative to full scale.
%ALDB%: The album loudness relative to full scale in dB/LUFS.

2011-12-18 0.9.2
The Linux version is build in a VMware Player 4.0.1 running Debian 6.0.3.
The VMware Player is set up following the instructions found here using a Debian 6.0.3 small CD image.
Currently CLI only.
Completly restructured build process.

2011-12-09 0.9.1
Provided more environment variables for the command option:
%RATE%: The sample rate.
%NCH%: The number of channels.
%BITS%: The bit depth.
Added more presets for the command option:
Physically apply the track gain using SoX (default):
sox "%TRACK%" "%DN%%BN%.wav" gain %TGDB%
Convert to MP3 and physically apply the track gain using lame (very useful for creating MP3s to be used with your mobile MP3 player, requires "lame.exe" to be copied into the subfolder "r128gain"):
lame --noreplaygain --scale %TG% -V2 "%TRACK%" "%DN%%BN%.mp3"
Decode using SoX and convert to MP3 by physically applying the track gain using lame (very useful for creating MP3s to be used with your mobile MP3 player, requires "lame.exe" to be copied into the subfolder "r128gain"):
sox --no-dither "%TRACK%" -t raw - | lame --noreplaygain --scale %TG% -r --bitwidth %BITS% -s %RATE% -V2 - "%DN%%BN%.mp3"
Fixed a glitch regarding switching between the "command" and other output modes.

2011-11-20 0.9
Set default gate to -10.0 LUFS and default block overlap to 75% (according to the latest EBU R128 and BS1770-2 specifications.)
Avoid division by zero in LIB1770 (implies a slight API change.)
Further improved GUI synchronization.

2011-10-08 0.8.8
Implemented some GUI synchronization with respect to the "command" feature.
Wrapped arguments in the "command" preset with double quotation marks (").
Extended number of lines in input list.
Distribute limited versions of "sox.exe" and "ffmpeg.exe" for usage whithin the "command".

2011-10-03 0.8.7
Implemented an alternate BS.1770 statistics using a histogram as proposed in "". The histogram based statistics avoids memory overflow and appears to improve performance. The new histogram based statistics is default.

The public API of lib1770 is changed slightly in order to allow for choosing the statistcs algorithm, either histogram or sequence.

Provided an option to execute a command in addition to the build-in actions to be enabled via the "Format" drop down box. The command's environment provides the following variables:

%PATH%: The systems's path extended by the sub-directory "r128gain".
%TRACK%: The complete path to the source track.
%NAME%: The name of the source track including the extension.
%BN%: The base name of the source track, i.e. excluding the extension.
%EXT%: The extension of the source track.
%DN%: The output directory.
%TG%: The track gain.
%TGDB%: The track gain in dB.
%TP%: The track peak.
%TPDB%: The track peak in dB.
%AG%: The album gain.
%AGDB%: The album gain in dB.
%AP%: The album peak.
%APDB%: The album peak in dB.

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, or
Please 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.
Hide changelog

Sections/Browse similar tools

Guides and How to's

Acronyms / Also Known As

BS1770GAIN, r128gain

Download BS1770GAIN Portable download from the Download links under Download and Download other versions!

Share software

Facebook    Twitter    Reddit    LinkedIn    Pinterest    Google+    Email

Notify me when software updated or report software

Email me when it has been updated    Report this software (dead link/new version)  

0 reviews, Showing 0 to 0 reviews
0 reviews, Showing 0 to 0 reviews

1 tool hits, Showing 1 to 1 tools

NEW SOFTWARE= New tool since your last visit
NEW VERSION= New version since your last visit
NEW REVIEW= New review since your last visit
NEW VERSION= New version

Latest version
Version number / Beta version number / Update version number and when it whas released.

Type and download
NO MORE UPDATES? = The software hasn't been updated in over 2 years.
NO LONGER DEVELOPED = The software hasn't been updated in over 5 years.
RECENTLY UPDATED = The software has been updated the last 31 days.
Freeware = Download Free software.
Freeware Trialware = Download Free software but some parts are trial/shareware.
Free software = Download Free software and also open source code also known as FOSS (Free and Open Source Software).
Free software Trialware = Download Free software and also open source code but some parts are trial/shareware.
Freeware Ads = Download Free software but supported by advertising, usually with a included browser toolbar. It may be disabled when installing or after installation.
Free software Ads = Free Download software and open source code but supported by advertising, usually with a included browser toolbar. It may be disabled when installing or after installation.
Trialware = Also called shareware or demo. Free Trial version available for download and testing with usually a time limit or limited functions.
Payware = No demo or trial available.
Portable version = A portable/standalone version is available. No installation is required.
v1.0.1 = Latest version available.
Download beta = It could be a Beta, RC(Release Candidate) or an Alpha / Nightly / Unstable version of the software.
Download 15MB = A direct link to the software download.
Win = Windows download version. It works on 32-bit and 64-bit Windows.
Win64 = Windows 64-bit download version. It works only on 64-bit Windows.
Mac = Mac download version. It works on 32-bit and 64-bit Mac OS.
Mac64 = Mac OS download version. It works only on 64-bit Mac OS.
Linux = Linux download version.
Portable = Portable version. No installation is required.
Ad-Supported = The software is bundled with advertising. Be careful when you install the software and disable addons that you don't want!
Visit developers site = A link to the software developer site.
Download (mirror link) = A mirror link to the software download. It may not contain the latest versions.
Download old versions = Free downloads of previous versions of the program.
Download 64-bit version = If you have a 64bit operating system you can download this version.
Download portable version = Portable/Standalone version meaning that no installation is required, just extract the files to a folder and run directly.
Portable version available = Download the portable version and you can just extract the files and run the program without installation.
Old versions available = Download old versions of the program.
Version history available = Complete changelog on our site.
Windows = Windows version available.
Mac OS = Mac OS version available.
Linux = Linux version available.
Our hosted tools are virus and malware scanned with several antivirus programs using

Rating from 0-10.

Browse software by sections

Search   Contact us   Privacy Policy   About   Advertise   Forum   RSS Feeds   Statistics   Software   

Site layout: Default Classic Blue