desbma / r128gain

Fast audio loudness scanner & tagger (ReplayGain v2 / R128)
GNU Lesser General Public License v2.1
170 stars 9 forks source link

Commandline arg to switch between "RGv2", "ebur128" and "atsc" modes? #14

Closed Moonbase59 closed 5 years ago

Moonbase59 commented 5 years ago

For mixed environments (like mine, old media being "replaygained" with v1 algorithm at 89 dB target, and newer media using the EBU R128/BS.1770 standard with -23 LUFS target and gating), it might just be great if we had a means of easily switching the intended target loudness, mode, and units.

For compatibility with older ReplayGain, r128gain could/should be as ist is—following the EBU R128 recommendation but with a differnt target of -18 LUFS (specified in old "dB" tag values).

Then again, some of us already produce/tag for more modern standards like:

EBU R128/BS.1770-2/-3/-4: Target -23 LUFS, with gating, "LU"/"LUFS" units

"Varied" EBU R128, i.e. different target loudness, for example: Target -18 LUFS, with gating, "LU"/"LUFS" units (instead of "dB")

ATSC A/85: Target -24 LUFS, no gating, "LU"/"LUFS" units

There are actually programs that can handle stuff like that, like IDJC, Audacious, my soon-to-be-released version 0.4.5 of ices. IDJC even allows to set a different pregain for files tagged using "LU/LUFS" units.

So it’s be just great if we could specify on the commandline: – the desired target loudness (like -16/-18/-23/-24 LUFS) – and/or a mode like ebur128, rgv2, atsc (does ffmpeg handle "gating/no gating" or ATSC A/85?) – the desired units for the tags (LU/LUFS vs. dB)

If all this sounds too complicated, it might be easier and less error-prone for the majority of users to just select between two "modes", ReplayGainv2 being the default, maybe like this:

r128gain … —or— r128gain --mode=rgv2 … would use a target of -18 LUFS, gating, and "dB" units (as is)

r128gain --mode=ebur128 … would use a target of -23 LUFS, gating, and "LU"/"LUFS" units (new)

maybe even (if ffmpeg handles that) r128gain --mode=atsc … would use a target of -24 LUFS, no gating, and "LU"/"LUFS" units (new but probably not often needed)

For these cases, it might be advisable to also store the REPLAYGAIN_REFERENCE_LOUDNESS tag (see my other issue #13).

Otherwise, thanks for your efforts to bring us a very usable tool!

desbma commented 5 years ago

Sorry, I do not intend to support every possible loudness analysis algorithm.

My goal is only to provide a simple tool that supports the RGv2 standard, wich already works with many audio players, because it has been designed to be backward compatible with RGv1.