IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
Adding RG info with Lame: what is the point if it isn't supported?, Split From: lame3995m - a constraint vbr variant (#103453)
greynol
post Dec 7 2013, 01:28
Post #1





Group: Super Moderator
Posts: 10339
Joined: 1-April 04
From: San Francisco
Member No.: 13167



QUOTE (halo001 @ Dec 6 2013, 06:58) *
I often use the --replaygain-accurate parameter on lame commandline encoder. I always enable this setting for decoding purpose.

What decoder are you using that makes use of replaygain information stored in the Lame header?


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
halo001
post Dec 7 2013, 09:00
Post #2





Group: Members
Posts: 15
Joined: 26-February 13
From: Philippines
Member No.: 106896



I don't have any issues regarding compatibility and dynamics. The main reason I use --replaygain-accurate is to enable decoding on the fly on my portable devices.
Go to the top of the page
+Quote Post
greynol
post Dec 7 2013, 16:03
Post #3





Group: Super Moderator
Posts: 10339
Joined: 1-April 04
From: San Francisco
Member No.: 13167



I doubt completely that any of your players are reading RG metadata from the Lame header. I skimmed the Lame changelog and didn't see anything about it being placed in an ID3v2 tag. Can anyone confirm that this variant of Lame does?


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
[JAZ]
post Dec 8 2013, 12:31
Post #4





Group: Members
Posts: 1798
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



QUOTE (halo001 @ Dec 7 2013, 09:00) *
I don't have any issues regarding compatibility and dynamics. The main reason I use --replaygain-accurate is to enable decoding on the fly on my portable devices.


Now that I am updating the documentation, i see that this could be a misinterpretation of what it actually meant.

It says:
QUOTE
--replaygain-accurate Slightly more accurate ReplayGain analysis and finding the peak sample

Enable decoding on the fly. Compute "Radio" ReplayGain on the decoded data stream. Find the peak sample of the decoded data stream and store it in the file.


What it really means is:

QUOTE
--replaygain-accurate Slightly more accurate ReplayGain analysis and finding the peak sample

Compute "Radio" ReplayGain on the decoded data stream. Find the peak sample by decoding on the fly the encoded data stream and store it in the file.
Go to the top of the page
+Quote Post
BFG
post Dec 10 2013, 07:16
Post #5





Group: Members
Posts: 211
Joined: 22-July 12
Member No.: 101637



Frankly, unless LAME implements ReplayGain 2.0 and/or we find some players/decoders that actually use the analysis, I think it's a moot point.
Go to the top of the page
+Quote Post
TomasPin
post Dec 10 2013, 18:32
Post #6





Group: Members
Posts: 204
Joined: 5-June 13
From: Argentina
Member No.: 108508



QUOTE (BFG @ Dec 10 2013, 03:16) *
Frankly, unless LAME implements ReplayGain 2.0 and/or we find some players/decoders that actually use the analysis, I think it's a moot point.

Though it'd be quite handy, there's not that much of a difference between 1.0 and 2.0, at much a few DBs in my experience...

This post has been edited by TomasPin: Dec 10 2013, 18:37


--------------------
A man and his music: http://tubular.net/
Go to the top of the page
+Quote Post
greynol
post Dec 10 2013, 18:40
Post #7





Group: Super Moderator
Posts: 10339
Joined: 1-April 04
From: San Francisco
Member No.: 13167



I fail to see it being handy at all if there is no player that reads the metadata from the location where Lame writes it.

Unless someone is going to say that this forked version of Lame writes RG to an ID3V2 tag, I don't see the point in continuing this line of discussion.

Hopefully halo001 is satisfied with the replies received relevant to this topic. All I wanted to point out was that


there is likely no need to be concerned with --replaygain-accurate or even bother using it since it likely isn't going to do anything but consume CPU resources unnecessarily.

EDIT: I split the discussion, so what was stricken above is no longer relevant.

This post has been edited by greynol: Dec 10 2013, 19:46


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
TomasPin
post Dec 10 2013, 19:03
Post #8





Group: Members
Posts: 204
Joined: 5-June 13
From: Argentina
Member No.: 108508



QUOTE (greynol @ Dec 10 2013, 14:40) *
I fail to see it being handy at all if there is no player that reads the metadata from the location where Lame writes it.

Good point, didn't know that... sorry.


--------------------
A man and his music: http://tubular.net/
Go to the top of the page
+Quote Post
robert
post Dec 10 2013, 19:54
Post #9


LAME developer


Group: Developer
Posts: 789
Joined: 22-September 01
Member No.: 5



Madplay seems to be some player, which used the replaygain info stored in the header:

http://www.hydrogenaudio.org/forums/index....st&p=305970

Myself, I don't use the replaygain features in LAME. What I do is, let wavegain calc album gains once and for all for my CD backup, then have LAME apply a proper scale value when encoding the wave files to mp3.
Go to the top of the page
+Quote Post
greynol
post Dec 10 2013, 20:10
Post #10





Group: Super Moderator
Posts: 10339
Joined: 1-April 04
From: San Francisco
Member No.: 13167



...and the ancient plugin for Winamp.

I do essentially the same thing:
CD -> FLAC -> Add RG with foobar2000 -> Lame using --scale switch.

This post has been edited by greynol: Dec 10 2013, 20:11


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
mjb2006
post Dec 10 2013, 21:54
Post #11





Group: Members
Posts: 860
Joined: 12-May 06
From: Colorado, USA
Member No.: 30694



QUOTE (TomasPin @ Dec 10 2013, 11:32) *
there's not that much of a difference between 1.0 and 2.0, at much a few DBs in my experience...

My experience is the same, for most music. However, the newer standard gives me about 5 dB of additional reduction on bass-heavy tracks. For me, that's definitely noticeable. It also is exactly what those tracks needed in order to be more in line with the others. (And when I say bass-heavy, I mean tracks that are mostly bass.)
Go to the top of the page
+Quote Post
JJZolx
post Dec 11 2013, 02:02
Post #12





Group: Members
Posts: 415
Joined: 26-November 04
Member No.: 18345



QUOTE
Adding RG info with Lame: what is the point if it isn't supported?


That's a damned good question. Why don't the LAME developers give an option to write this data to ID3v2 TXXX/REPLAYGAIN_TRACK_GAIN and TXXX/REPLAYGAIN_TRACK_PEAK frames instead of (or in addition) to the LAME tag where few applications will read it?

I may be one of the few people who _does_ use --replaygain-accurate when encoding with LAME and actually makes use of the data. I have a script that does transcoding from FLAC and after running LAME with --replaygain-accurate, it uses LameTag to read the values and then metamp3 to write them to TXXX/REPLAYGAIN frames.
Go to the top of the page
+Quote Post
greynol
post Dec 11 2013, 02:27
Post #13





Group: Super Moderator
Posts: 10339
Joined: 1-April 04
From: San Francisco
Member No.: 13167



I've fooled around with LameTag to do that once or twice, but didn't incorporate it into my process because I use album gain.

http://www.hydrogenaudio.org/forums/index....st&p=755464

This post has been edited by greynol: Dec 12 2013, 23:59


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
JJZolx
post Dec 11 2013, 06:20
Post #14





Group: Members
Posts: 415
Joined: 26-November 04
Member No.: 18345



Yeah, I'm still looking for an easy way to add ReplayGain tags, including album gain, from the command line. You might notice that I ask about it every month or so. wink.gif

But in truth, I'm not sure how much I'd use album gain on my portable players, which is where I use Mp3. The more closely matched track gain might still be more desirable to me when pounding out the miles on the treadmill or bike. The subtleties of relative volume levels of tracks on an album may be completely lost on me in that use case.
Go to the top of the page
+Quote Post
skamp
post Dec 11 2013, 08:15
Post #15





Group: Developer
Posts: 1454
Joined: 4-May 04
From: France
Member No.: 13875



QUOTE (JJZolx @ Dec 11 2013, 06:20) *
Yeah, I'm still looking for an easy way to add ReplayGain tags, including album gain, from the command line.


On Linux: caudec -g *.mp3


--------------------
See my profile for measurements, tools and recommendations.
Go to the top of the page
+Quote Post
BFG
post Dec 11 2013, 19:44
Post #16





Group: Members
Posts: 211
Joined: 22-July 12
Member No.: 101637



QUOTE (JJZolx @ Dec 10 2013, 19:02) *
Why don't the LAME developers give an option to write this data to ID3v2 TXXX/REPLAYGAIN_TRACK_GAIN and TXXX/REPLAYGAIN_TRACK_PEAK frames instead of (or in addition) to the LAME tag where few applications will read it?

Good point. I suspect that if that modification were made, and ReplayGain V2.0 support was added, a LOT of people would start using the function again. Any idea if a formal request has been made of the developers? (I can't access sourceforge ATM.)
Go to the top of the page
+Quote Post
lvqcl
post Dec 11 2013, 20:21
Post #17





Group: Developer
Posts: 3468
Joined: 2-December 07
Member No.: 49183



http://sourceforge.net/p/lame/feature-requests/78/ -- "Write ReplayGain frames to ID3v2 tag" (2012-02-19)
Go to the top of the page
+Quote Post
halo001
post Dec 12 2013, 11:13
Post #18





Group: Members
Posts: 15
Joined: 26-February 13
From: Philippines
Member No.: 106896



So far things cleared out on how lame writes replaygain. Hope future lame versions support writing RG tags on ID3v2. As for now, I'll use foobar's replaygain scanner instead. I'll try to manually modify the default RG values. So can anyone recommend me values which atleast is optimized for any tracks? Thanks for all feedbacks.

This post has been edited by halo001: Dec 12 2013, 11:23
Go to the top of the page
+Quote Post
[JAZ]
post Dec 12 2013, 16:47
Post #19





Group: Members
Posts: 1798
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



QUOTE (halo001 @ Dec 12 2013, 11:13) *
[...] I'll try to manually modify the default RG values. So can anyone recommend me values which atleast is optimized for any tracks? [...]


Probably you mean "target loudness" where you said "default RG value". There isn't such a thing as a "default RG value", neither there can be a RG value (nor target loudness), optimized for everything.




Quick guide to Replaygain:

Let's take a recording of a piano, recorded to digital using two microphones, one placed next to the piano, and another placed at five meters from the piano.
As it should be obvious, the microphone nearer to the piano will record the sound at a higher amplitude than the one placed far from it, but both would have captured the same sound.


On playback, we would like both to sound at the same loudness (which does not mean the same amplitude, although in this case, because it is exactly the same sound, it probably will also be the same amplitude).

To do so, we would need to either decrease the sound recorded from the first microphone, or amplify the sound recorded from the second microphone. (More on what is the better option later)
So we reduce the volume of the sound from the first microphone, and take note of how much we needed to change the volume so that it played like the second microphone.

Said all this, Replaygain is a technology that is able to determine by how much the volume of the microphone A will need to be reduced (or generally speaking, altered), in order to be played at the same loudness than another recording B (Reference) which we have determined to be the desirable loudness.
Then, this amount is usually stored in a tag so that players can apply the volume change. (MP3Gain is different in that it actually modifies the content of the file, but in a way that also represents changing the volume)


So we need to know two things:
* Reference loudness: The specification says how this is calculated, but it is enough to say that it's the loudness of a determined signal, played at a specified volume. The target Replaygain Value to achieve this loudness was originally 83dBL, but soon after standardization it was changed to 89dBL which is what has been since. (The R128 standard uses a different way to measure it, but we could say that, approximately, its target loudness is 84dBL)
* Way to calculate the loudness: This also is described in the specification, but it's important to note that the amplitude is only slightly relevant respect to the loudness. A lower amplitude signal can perfectly be several dBL louder than a higher amplitude one.
* A way to store the loudness , so that it can be played back at the same loudness than the reference signal. As I said above, this is stored in a tag.


One cannot get a random target loudness, neither can a target loudness by itself be any more good than another target loudness (except, of course, if one of the values is extremely far from usual values).




The only reason why a different target loudness is desirable is when the device does a poor job (not loud enough, or noisy) playing at the default target loudness, or also in the case where one would mix tracks that have Replaygain info with tracks/streams that do not have them.
That's why some software, like foobar2000, Winamp and others, have one or two pregain sliders in the Replaygain settings, in order to accommodate for this.

With this, I am saying that one rarely would want to modify the calculated Replaygain values of a track, but if possible, the pregain that is applied by the player.
Go to the top of the page
+Quote Post
onanboy
post Dec 12 2013, 23:33
Post #20





Group: Members
Posts: 12
Joined: 4-January 06
Member No.: 26850



QUOTE (greynol @ Dec 10 2013, 13:10) *
I do essentially the same thing:
CD -> FLAC -> Add RG with foobar2000 -> Lame using --scale switch.



I am interested in the --scale switch you mentioned Greynol.

I tried to search it but the best I could come up with is that it is not reliable for VBR. Are you using CBR or ABR with your Foobar conversions? What number do you put after the --scale switch?

Btw, I use Lame3100m (--bCVBR 266 - %d --replaygain-accurate --scale). I used to just scan the files after the conversion and then "Apply ReplayGain Data to MP3 Data" but this might remove a couple of steps.
Go to the top of the page
+Quote Post
greynol
post Dec 13 2013, 00:04
Post #21





Group: Super Moderator
Posts: 10339
Joined: 1-April 04
From: San Francisco
Member No.: 13167



http://www.hydrogenaudio.org/forums/index....st&p=601287

That --scale doesn't work reliably with VBR is news to me. I use VBR, so if I've been doing something "wrong" then I haven't noticed.

Is it possible that you either have bad information or didn't quite understand what it was that you read?

This post has been edited by greynol: Dec 13 2013, 00:40


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
halb27
post Dec 13 2013, 08:05
Post #22





Group: Members
Posts: 2446
Joined: 9-October 05
From: Dormagen, Germany
Member No.: 25015



QUOTE (onanboy @ Dec 12 2013, 23:33) *
...Btw, I use Lame3100m (--bCVBR 266 - %d --replaygain-accurate --scale). ...

'--scale' needs an argument (the scale factor). You get a warning if you use your setting from the cmd line.
Just keep foobar doing the replaygain work. That's what I do, too. Not a big task IMO.
BTW using '--scale' the way robert and Greynol do is not exactly the same thing. Their procedure has the additional property that they provide kind of a standard input loudness for the encoding process. I'm pretty sure they do it because of this.

This post has been edited by halb27: Dec 13 2013, 08:15


--------------------
lame3100m -V1 --insane-factor 0.75
Go to the top of the page
+Quote Post
[JAZ]
post Dec 13 2013, 13:52
Post #23





Group: Members
Posts: 1798
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



@onanboy: scale parameter

I also would like to know where you got it that this works worse for VBR, or any other mode.

By the very same nature of what the switch does, the effect on any mode is the same. What you might have read and incorrectly misunderstood is that CBR used to have a gain of 0.97 (i.e. reduce the volume slightly ) and VBR had it at 1.0 (i.e. no change).


As a side note, in the LAME 3.100 there has been added a complementary switch: -gain . This one accepts units in dB upcoming gain switch




Addendum about why it is beneficial to use the scale/gain switch versus letting ReplayGain analyze and apply the change:

Due to the Loudness war in the last decade, the loudness of music has consistently been increased. This increased loudness means higher amplitude in the different frequency bands, and usually an increase of the Noise Level (reducing the global SNR)

Lossy encoders (of which LAME MP3 is an example) use several tools too analyze the audio, and determine what data to maintain that allows them reconstruct the original audio in a way that audibly resembles the original.
Due to the increased loudness of current music, more data is (incorrectly) determined important to be maintained. Especially unneeded, if the intention is to apply Replaygain later on.
And more data to be maintained obviously means higher bitrate required.

It is because of this that applying the gain before the lossy encoding is able to reduce the required bitrate, while maintaining the same audible quality.

This post has been edited by [JAZ]: Dec 13 2013, 13:52
Go to the top of the page
+Quote Post
onanboy
post Dec 13 2013, 21:30
Post #24





Group: Members
Posts: 12
Joined: 4-January 06
Member No.: 26850



QUOTE ([JAZ] @ Dec 13 2013, 06:52) *

@onanboy: scale parameter

I also would like to know where you got it that this works worse for VBR, or any other mode.



I am sorry but I cannot find the post where (I thought) I read that someone said that there was something wrong with using Scale with VBR encoding. You are both probably correct that I misinterpreted the posting.

Thanks for correcting me and anybody that happens along to this thread. I appreciate the advice on the usage of the --scale parameter.

Onanboy
Go to the top of the page
+Quote Post
JJZolx
post Dec 14 2013, 00:28
Post #25





Group: Members
Posts: 415
Joined: 26-November 04
Member No.: 18345



QUOTE ([JAZ] @ Dec 13 2013, 06:52) *
It is because of this that applying the gain before the lossy encoding is able to reduce the required bitrate, while maintaining the same audible quality.

Is this in theory or is it supported by listening tests?
Go to the top of the page
+Quote Post

2 Pages V   1 2 >
Reply to this 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: 26th December 2014 - 22:37