IPB

Welcome Guest ( Log In | Register )

R128GAIN: An EBU R128 compliant loudness scanner
pbelkner
post Jan 5 2011, 19:38
Post #1





Group: Members
Posts: 412
Joined: 13-June 10
Member No.: 81467



I've just uploaded on sourceforge a first version of r128gain, an EBU R128 (http://tech.ebu.ch/loudness) compliant loudness scanner:
http://sourceforge.net/projects/r128gain/files/
  • process single files (tracks):
    • In order to just scan and analyze one file (WAV, FLAC or WV):
      CODE
      r128gain <file>
    • In order to scan, analyze and tag one file (currently only FLAC, result will be in <directory>):
      CODE
      r128gain <file> <directory>
    • In order to scan, analyze one file (WAV, WV) and encode and tag into FLAC (result will be in <directory>):
      CODE
      r128gain <file> <directory> flac
  • recursively process directories (the content of a directory is considered an album):
    • In order to just recursively scan and analyze a directory:
      CODE
      r128gain <directory>
    • In order to recursively scan, analyze and tag a directory:
      CODE
      r128gain <directory> <directory>
      r128gain <directory>/* <directory>
    • In order to recursively scan, analyze a directory and encode and tag into FLAC:
      CODE
      r128gain <directory> <directory> flac
      r128gain <directory>/* <directory> flac
Tagging is currently supported only for FLAC:
  • REPLAYGAIN_REFERENCE_LOUDNESS: always -23 LUFS (corresponding to EBU R128)
  • REPLAYGAIN_TRACK_GAIN: loudness difference to -23 LUFS in LU measured for this track
  • REPLAYGAIN_TRACK_PEAK: true peak measured at 192 kHz for this track
  • REPLAYGAIN_ALBUM_GAIN: loudness difference to -23 LUFS in LU measured for the whole album
  • REPLAYGAIN_ALBUM_PEAK: true peak measured at 192 kHz for the whole album
These tags should be honored by each Replay Gain compliant media player.
Go to the top of the page
+Quote Post
 
Start new topic
Replies
jdoering
post Jan 12 2011, 06:40
Post #2





Group: Members
Posts: 11
Joined: 6-January 11
Member No.: 87101



I had been hoping that the written tags were being converted into REPLAYGAIN compatible units (although I wondered). How are the flacs being tested being tested; a modified playback program as well? In that case is the correction algorithm applied at playback the same just different units / base?

New tags seems very unfortunate (given hardware device support, etc). New tags for the peak data wouldn't mean anything more than sample peak (ReplayGain) versus true signal peak (EBU R128); right? Would a playback program care about the distinction (would seem unlikely unless a fancy client had some way of estimating the worst-case error in sample-peak based on sampling frequency, etc ... sounds far fetched). In terms of the gain; I had been assuming that it was just a matter of converting units / reference levels. I guess the paper probably answers that. It sound interesting; too bad it's $20.

Also note that storing REFERENCE_LOUDNESS for ReplayGain is not a standard and probably doesn't make any more sense here than it does for ReplayGain (current non-standard metaflac behavior notwithstanding).

-Jeff
Go to the top of the page
+Quote Post
pbelkner
post Jan 12 2011, 10:21
Post #3





Group: Members
Posts: 412
Joined: 13-June 10
Member No.: 81467



QUOTE (jdoering @ Jan 12 2011, 07:40) *
I had been hoping that the written tags were being converted into REPLAYGAIN compatible units (although I wondered). How are the flacs being tested being tested; a modified playback program as well? In that case is the correction algorithm applied at playback the same just different units / base?

EBU R128 and ReplayGain are two different approaches to reach the same goal: uniform loudness at replay time.

Common to both approaches is to define an algorithm in order to determine at scan time
  • an absolute loudness, and
  • a relative loudness (gain) in order to adjust the loudness accordingly to a standardized absolute loudness at replay time.
Even if this is common to both approaches there are huge differences
  • The two algorithms are completely different. If you compare the relative loudness between different tacks achieved with ReplayGain and EBU R128 you will observe huge differences.
  • Hence it makes not much sense to have one part of your audio collection processed using ReplayGain and the other part using EBU R128. Propably it's best to decide beforehand which approach to use based on personal preferences (tests).
Metadata is not part of EBU R128. What R128GAIN does is writing the same tags as METAFLAC . Each playback software providing ReplayGain and honoring the METAFLAG tags should work with FLACs tagged by R128GAIN, e.g. Winamp. The loudness level than will be -23 LUFS as requiered by EBU R128 (completely different measure than RG's 83 dB).

Tests where performed using Winamp in conjunction with my own SoX and FFmpeg based input plugin. Native WA should do as well.

QUOTE (jdoering @ Jan 12 2011, 07:40) *
New tags seems very unfortunate (given hardware device support, etc). New tags for the peak data wouldn't mean anything more than sample peak (ReplayGain) versus true signal peak (EBU R128); right? Would a playback program care about the distinction (would seem unlikely unless a fancy client had some way of estimating the worst-case error in sample-peak based on sampling frequency, etc ... sounds far fetched). In terms of the gain; I had been assuming that it was just a matter of converting units / reference levels. I guess the paper probably answers that. It sound interesting; too bad it's $20.

Plaback software (as e.g. Winamp) makes use of the peak values (e.g. providing a clipping prevention mode). Whether it is amplitude peak or true peak will become intersting in case there is some up-sampling in the playback chain, and propably it is, because each contemporary DAC does it. Hence you should always store true peaks.

QUOTE (jdoering @ Jan 12 2011, 07:40) *
Also note that storing REFERENCE_LOUDNESS for ReplayGain is not a standard and probably doesn't make any more sense here than it does for ReplayGain (current non-standard metaflac behavior notwithstanding).

Maybe it could become part of the RG standard:
  • It would help to resolve the 83 dB vs. 89 dB debate.
  • It would help to integrate playback of ReplayGain tagged and EBU R128 tagged tracks depending
on the unit dB vs. LU, provided someone figures out the mean relative loudness between the two approaches.
Go to the top of the page
+Quote Post
jdoering
post Jan 12 2011, 21:24
Post #4





Group: Members
Posts: 11
Joined: 6-January 11
Member No.: 87101



QUOTE (pbelkner @ Jan 12 2011, 01:21) *
QUOTE (jdoering @ Jan 12 2011, 07:40) *
Also note that storing REFERENCE_LOUDNESS for ReplayGain is not a standard and probably doesn't make any more sense here than it does for ReplayGain (current non-standard metaflac behavior notwithstanding).

Maybe it could become part of the RG standard:
  • It would help to resolve the 83 dB vs. 89 dB debate.
  • It would help to integrate playback of ReplayGain tagged and EBU R128 tagged tracks depending
on the unit dB vs. LU, provided someone figures out the mean relative loudness between the two approaches.


In various past threads (including this one by David) strong cases have been made against storing the reference level. I don't think it's needed for the original ReplayGain nor for an EU R128 based solution. In both cases the reference points are now well understood and essentially part of the standard (89 dB and -23 LU).

For existing player compatibility; I think it's a bad idea to change the meaning of the existing tags. Existing players can't be expected to do anything meaningful with REFERENCE_LOUDNESS. Further although it sounds like the one's you've tested are happily ignoring the units (dB verus LU) in the VorbisComment tags; assuming that is not a good idea for standardization. An existing player could quite reasonably ignore the tags altogether since it doesn't understand the LU unit.

Points on a homogenously processed library are good; but I don't think a player or the standard should presume that situation when reusing existing tags. A legacy player encountering a heterogeneously processed set of music might (a) ignore the new RG128 tags due to the LU units or (B) apply the value as is likely resulting in a significant loudness discrepency between true ReplayGain tags and RG128-overloaded ReplayGain tags. An update player might handle the situation better based on noticing the LU units or perhaps the REFERENCE_LEVEL. But I think there is a better way in terms of compatibility.

Assuming that some REPLAYGAIN_RG128_CONVERSION_FACTOR can be defined (for the momemt I'll allow for the situation where it is not fixed; allowing for alternative approaches such as ref_pink.wav calibaration versus averaging over a large sample set); it seems ideal to store that in a new tag and while storing ReplayGain-compatible values in the original tags. A legacy player would be able to handle heterogenous libraries reasonably (within the inherent limitations of defining a conversion factor and mixing algorithms); while an updated player could optionally use the conversion factor to convert the ReplayGain back to true EBU R128 compliant values. For a homogeneous EBU R128 library nothing is lost. The conversion factor may not provide perfect handling of heterogenous cases; but as a constant factor it can't make the situation any worse for homogenous libraries (beyond having to adjust the initial volume knob once compared to the quieter values provided by the current true EBU R128 compliant solution).

If we want a "pure" EBU R128 approach; I believe that should be stored in separate tags (as suggested earlier) either specific to this case or perhaps some generalized ReplayGain 2.0 spec that allows for explicitly indicating algorithms, etc but that doesn't overload the meaning of existing tags.

I think the current solution of overloading ReplayGain tags should be reserved for special use-cases (and thus not be a default or recommend behavior). It is only reasonable for homogenously processed libraries and is really a hack as a new RG128 compliant player doesn't need to overload ReplayGain tags in a non-standard way while compatibility with existing players can only be determined empirically since the overloading is not based on any flexibility in the existing ReplayGain/VorbisComment specs.

In terms of peak; I suspect that substituting the more accurate wave peak should be an acceptable backward-compatible replacement for the sample-peaks currently specified by ReplayGain. Updated players could assume true-peaks when the conversion factor tag is present. Legacy players won't know the difference; but it's unlikely that they were doing anything fancy about the discrepency anyway. The true-peaks should just allow improved clipping prevention.

-Jeff
Go to the top of the page
+Quote Post

Posts in this topic
- pbelkner   R128GAIN: An EBU R128 compliant loudness scanner   Jan 5 2011, 19:38
- - googlebot   Didn't try the tool, yet, but had a look at th...   Jan 5 2011, 20:13
|- - pbelkner   QUOTE (googlebot @ Jan 5 2011, 21:13) Did...   Jan 5 2011, 21:32
- - C.R.Helmrich   Wow, thank you so much for this tool! I was al...   Jan 5 2011, 23:23
|- - pbelkner   QUOTE (C.R.Helmrich @ Jan 6 2011, 00:23) ...   Jan 6 2011, 00:46
|- - C.R.Helmrich   QUOTE (pbelkner @ Jan 6 2011, 01:46) It i...   Jan 6 2011, 15:23
|- - pbelkner   QUOTE (C.R.Helmrich @ Jan 6 2011, 16:23) ...   Jan 6 2011, 16:03
|- - googlebot   QUOTE (pbelkner @ Jan 6 2011, 16:03) What...   Jan 7 2011, 21:34
|- - pbelkner   QUOTE (googlebot @ Jan 7 2011, 22:34) I a...   Jan 7 2011, 22:17
|- - googlebot   QUOTE (pbelkner @ Jan 7 2011, 22:17) It s...   Jan 7 2011, 22:35
|- - pbelkner   QUOTE (googlebot @ Jan 7 2011, 23:35) PS ...   Jan 7 2011, 23:21
|- - C.R.Helmrich   QUOTE (pbelkner @ Jan 8 2011, 00:21) Many...   Jan 8 2011, 14:29
|- - pbelkner   QUOTE (C.R.Helmrich @ Jan 8 2011, 15:29) ...   Jan 10 2011, 17:38
|- - pbelkner   QUOTE (pbelkner @ Jan 10 2011, 18:38) The...   Jan 10 2011, 18:01
|- - C.R.Helmrich   Exactly, and if you pull out the "/n" in...   Jan 10 2011, 18:20
- - Fandango   On a completely other note... What about patents? ...   Jan 6 2011, 01:53
|- - mudlord   QUOTE (Fandango @ Jan 5 2011, 18:53) On a...   Jan 6 2011, 13:22
|- - cpchan   QUOTE (mudlord @ Jan 6 2011, 08:22) The o...   Jan 6 2011, 13:44
|- - mudlord   QUOTE (cpchan @ Jan 6 2011, 07:44) QUOTE ...   Jan 6 2011, 13:46
- - Notat   Congratulations on this! I know that BS.1770 ...   Jan 6 2011, 02:37
- - mudlord   What is the license for the tool?   Jan 6 2011, 03:42
- - A_Man_Eating_Duck   i can't for the life of me get this app to jus...   Jan 6 2011, 08:14
|- - pbelkner   QUOTE (A_Man_Eating_Duck @ Jan 6 2011, 09...   Jan 6 2011, 09:34
- - pbelkner   QUOTE (Fandango @ Jan 6 2011, 02:53) On a...   Jan 6 2011, 09:19
|- - mudlord   QUOTE (pbelkner @ Jan 6 2011, 02:19) It...   Jan 6 2011, 13:20
|- - pbelkner   QUOTE (mudlord @ Jan 6 2011, 14:20) QUOTE...   Jan 6 2011, 15:26
|- - Soap   QUOTE (pbelkner @ Jan 6 2011, 09:26) Both...   Jan 6 2011, 15:53
|- - cpchan   QUOTE (Soap @ Jan 6 2011, 10:53) ffmepg i...   Jan 6 2011, 16:09
|- - pbelkner   QUOTE (Soap @ Jan 6 2011, 16:53) QUOTE (p...   Jan 6 2011, 16:13
|- - Soap   QUOTE (pbelkner @ Jan 6 2011, 10:13) QUOT...   Jan 6 2011, 16:21
|- - pbelkner   QUOTE (Soap @ Jan 6 2011, 17:21) QUOTE (p...   Jan 6 2011, 16:49
|- - saratoga   QUOTE (pbelkner @ Jan 6 2011, 10:49) QUOT...   Jan 6 2011, 18:37
|- - cpchan   QUOTE (saratoga @ Jan 6 2011, 13:37) That...   Jan 7 2011, 01:39
- - Zao   Note that "use" in mudlord's post is...   Jan 6 2011, 13:29
|- - cpchan   QUOTE (Zao @ Jan 6 2011, 08:29) If you ev...   Jan 6 2011, 13:48
|- - Zao   QUOTE (cpchan @ Jan 6 2011, 13:48) QUOTE ...   Jan 6 2011, 13:52
|- - cpchan   QUOTE (Zao @ Jan 6 2011, 08:52) If more k...   Jan 6 2011, 13:59
- - Zao   Even if the end artifact is a program, this preven...   Jan 6 2011, 13:47
|- - cpchan   QUOTE (Zao @ Jan 6 2011, 08:47) Even if t...   Jan 6 2011, 13:52
|- - Zao   QUOTE (cpchan @ Jan 6 2011, 13:52) What i...   Jan 6 2011, 13:54
- - Zao   If a developer uses a library with one of the usua...   Jan 6 2011, 14:02
|- - cpchan   QUOTE (Zao @ Jan 6 2011, 09:02) If a deve...   Jan 6 2011, 14:14
- - lvqcl   Please remember that QUOTE (pbelkner @ Jan 6 ...   Jan 6 2011, 14:10
- - Zao   You cannot always dynamically link to a library, a...   Jan 6 2011, 14:16
|- - cpchan   QUOTE (Zao @ Jan 6 2011, 09:16) You canno...   Jan 6 2011, 14:33
|- - mudlord   QUOTE (cpchan @ Jan 6 2011, 08:33) QUOTE ...   Jan 7 2011, 07:19
|- - googlebot   QUOTE (mudlord @ Jan 7 2011, 07:19)To avo...   Jan 7 2011, 10:46
|- - 2Bdecided   QUOTE (googlebot @ Jan 7 2011, 09:46) No ...   Jan 7 2011, 17:45
- - GHammer   Seven of 38 posts on software licensing. Geesh...   Jan 7 2011, 04:39
|- - mudlord   QUOTE (GHammer @ Jan 6 2011, 21:39) Seven...   Jan 7 2011, 07:14
- - romor   Bad talk. You are free to see his posts if you wan...   Jan 7 2011, 15:57
|- - Soap   forget it.   Jan 7 2011, 16:43
|- - staale   Hi, Just wanted to add that we've released ou...   Jan 7 2011, 17:08
- - googlebot   Forget this, too. Else the joke doesn't work o...   Jan 7 2011, 17:02
- - jangk   Hello, back to audio issues again. Thank you pbel...   Jan 7 2011, 17:27
|- - pbelkner   QUOTE (jangk @ Jan 7 2011, 18:27) Am I mi...   Jan 7 2011, 18:13
|- - jangk   QUOTE (pbelkner @ Jan 7 2011, 18:13) QUOT...   Jan 7 2011, 19:13
|- - pbelkner   QUOTE (jangk @ Jan 7 2011, 20:13) Anyhow,...   Jan 7 2011, 19:56
- - mudlord   QUOTE How about you program your own lib or shut u...   Jan 7 2011, 18:57
- - jdoering   Please pardon the noob here; hopefully I'm kee...   Jan 8 2011, 00:28
|- - googlebot   Completely agree! One doesn't really have ...   Jan 8 2011, 01:51
|- - pbelkner   QUOTE (jdoering @ Jan 8 2011, 01:28) But ...   Jan 8 2011, 09:32
- - Notat   I have it on good authority that the calculation c...   Jan 8 2011, 18:42
- - googlebot   A fully standard compliant single-pass outline is ...   Jan 8 2011, 19:40
- - pbelkner   v0.3 released I've just uploaded the new vers...   Jan 9 2011, 18:47
|- - googlebot   QUOTE (pbelkner @ Jan 9 2011, 18:47) CODE...   Jan 12 2011, 20:26
|- - pbelkner   QUOTE (googlebot @ Jan 12 2011, 21:26) QU...   Jan 13 2011, 10:26
- - googlebot   Works perfectly, great job! Even for multichan...   Jan 10 2011, 09:58
- - googlebot   Just out of curiosity, where does that 0.4 come fr...   Jan 10 2011, 18:35
|- - jdoering   QUOTE (googlebot @ Jan 10 2011, 09:35) Ju...   Jan 10 2011, 19:27
- - googlebot   Duh. My bad!   Jan 10 2011, 21:40
- - Fandango   I have a proposal. New standard tag fields: EBU_...   Jan 11 2011, 23:14
|- - Notat   QUOTE (Fandango @ Jan 11 2011, 15:14) Wit...   Jan 12 2011, 04:11
|- - Fandango   QUOTE (Notat @ Jan 12 2011, 04:11) QUOTE ...   Jan 13 2011, 16:21
|- - pbelkner   QUOTE (Fandango @ Jan 13 2011, 17:21) But...   Jan 13 2011, 17:01
||- - 2Bdecided   QUOTE (pbelkner @ Jan 13 2011, 16:01) EBU...   Jan 13 2011, 17:24
|- - 2Bdecided   QUOTE (Fandango @ Jan 13 2011, 15:21) Mos...   Jan 13 2011, 17:20
- - Fandango   PS: I'd say that using GAIN in your prefix is ...   Jan 12 2011, 02:02
- - jdoering   I had been hoping that the written tags were being...   Jan 12 2011, 06:40
|- - pbelkner   QUOTE (jdoering @ Jan 12 2011, 07:40) I h...   Jan 12 2011, 10:21
|- - jdoering   QUOTE (pbelkner @ Jan 12 2011, 01:21) QUO...   Jan 12 2011, 21:24
|- - pbelkner   QUOTE (jdoering @ Jan 12 2011, 22:24) I t...   Jan 13 2011, 11:01
- - jdoering   Just compared r128gain output versus ReplayGain fo...   Jan 12 2011, 10:18
- - googlebot   I think you both have a valid point. I also think...   Jan 12 2011, 12:58
|- - pbelkner   QUOTE (googlebot @ Jan 12 2011, 13:58) =...   Jan 12 2011, 13:14
||- - C.R.Helmrich   QUOTE (pbelkner @ Jan 12 2011, 14:14) QUO...   Jan 12 2011, 18:27
|||- - Notat   QUOTE (C.R.Helmrich @ Jan 12 2011, 10:27)...   Jan 13 2011, 02:57
|||- - jdoering   QUOTE (Notat @ Jan 12 2011, 17:57) QUOTE ...   Jan 13 2011, 06:21
|||- - C.R.Helmrich   QUOTE (jdoering @ Jan 13 2011, 07:21) I...   Jan 13 2011, 10:25
|||- - pbelkner   QUOTE (C.R.Helmrich @ Jan 13 2011, 11:25)...   Jan 13 2011, 10:37
||- - 2Bdecided   QUOTE (pbelkner @ Jan 12 2011, 12:14) QUO...   Jan 13 2011, 11:23
||- - Notat   QUOTE (2Bdecided @ Jan 13 2011, 03:23) Yo...   Jan 13 2011, 15:41
|- - pbelkner   QUOTE (googlebot @ Jan 12 2011, 13:58) PS...   Jan 12 2011, 17:07
- - googlebot   How large are the expected differences? Is there a...   Jan 12 2011, 18:46
- - C.R.Helmrich   True. I guess for the averaging we should leave ou...   Jan 12 2011, 19:00
- - Raiden   What is so special about pink noise? How does pink...   Jan 13 2011, 11:44
- - googlebot   Pink noise has equal energy over all octaves. It...   Jan 13 2011, 12:02
- - jangk   Thank you Notat for the link to AES "Loudness...   Jan 13 2011, 13:57
- - benski   I'm with David. I think we should verify the ...   Jan 13 2011, 17:27
- - Fandango   So if the old tags are used, how do I know whether...   Jan 13 2011, 18:22
6 Pages V   1 2 3 > » 


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 29th December 2014 - 15:42