desbma / r128gain

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

Option to remove lowercased similar tags #3

Closed porsager closed 5 years ago

porsager commented 5 years ago

Hi.

Thanks a lot for a very nice tool!! Took me quite a while to find one that supported as many formats as this - good job!

Now I've used it on quite some files, and some of them have incorrect tags in lowercase like:

replaygain track gain           : -7.00 dB
replaygain track peak           : 0.811597
replaygain originator code      : 011011000000

It would be nice to have an option of removing those to ensure players don't accidentally use the wrong one (and it feels cleaner).

Is that something you'd consider implementing?

desbma commented 5 years ago

I am not a big fan of the idea of removing existing tags. I assume the user knows what he/she was doing, when they were added. Even if this is optional, I don't want to make an inventory of all the possible competing or invalid gain tag formats to remove.

I have never encoutered such files though, do you have an example?

porsager commented 5 years ago

You're right, it's probably better done in it's own step before/after, I just thought that since it was the same tag, but only different casing it would be reasonable to assume you wouldn't want to keep it.

I wouldn't expect the replaygain originator code from my sample above to be removed..

Here's an example. oppe.mp4.zip

desbma commented 5 years ago

Interesting, the actual MP4 tags keys in the file are:

----:org.hydrogenaudio.replaygain:replaygain_originator_code
----:org.hydrogenaudio.replaygain:replaygain_track_gain
----:org.hydrogenaudio.replaygain:replaygain_track_peak

Whereas r128gain (and I believe, many other tools), read and write for MP4/AAC files:

----:COM.APPLE.ITUNES:REPLAYGAIN_TRACK_GAIN
----:COM.APPLE.ITUNES:REPLAYGAIN_TRACK_PEAK

So the case is not the only difference here. There are probably very few (if any) players that can interpret that tag. On the other hand, the ----:COM.APPLE.ITUNES:REPLAYGAIN_xxx format works with many Android players, Kodi TV sets, etc.

Ironically Hydrogenaudio is referenced in the tag, which is the community the Replay Gain standard comes from, and which clearly defines the tags as uppercase: https://wiki.hydrogenaud.io/index.php?title=ReplayGain_1.0_specification https://wiki.hydrogenaud.io/index.php?title=ReplayGain_2.0_specification

The MP4 tag key prefix is not defined though, so this a case of de facto standard.

porsager commented 5 years ago

Ah I see.

I'm sorry. I checked the tags using exiftool which doesn't give that much information, so I only saw:

REPLAYGAIN TRACK GAIN           : -7.20 dB
REPLAYGAIN TRACK PEAK           : 1.096478
replaygain track gain           : -7.27 dB
replaygain track peak           : 0.988696

Thanks a lot for your time and the explanation. I'll find a way to remove these :)

graue commented 5 years ago

@porsager, I'm running into this too. Do you have a solution to share?

I'm using eyeD3, which shows:

UserTextFrame: [Description: REPLAYGAIN_ALBUM_GAIN]
-6.10 dB
UserTextFrame: [Description: REPLAYGAIN_ALBUM_PEAK]
1.000000
UserTextFrame: [Description: REPLAYGAIN_TRACK_GAIN]
-5.30 dB
UserTextFrame: [Description: REPLAYGAIN_TRACK_PEAK]
1.000000
UserTextFrame: [Description: replaygain_album_gain]
-5.88 dB
UserTextFrame: [Description: replaygain_album_peak]
1.064615
UserTextFrame: [Description: replaygain_track_gain]
-4.41 dB
UserTextFrame: [Description: replaygain_track_peak]
1.031882
desbma commented 5 years ago

@graue Is this a MP3 file?

Anyway the best way would be to remove the invalid tags first (eyeD3 can do this), and then tag with r128gain.

porsager commented 5 years ago

@grauen I ended up using mutagen directly to add / edit tags.