IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
MP3Gain workaround needed for both fb2k / portable player, MP3Gain deleting ID3v2 Tags
Vittorio
post Aug 27 2012, 20:12
Post #1





Group: Members
Posts: 52
Joined: 25-January 09
Member No.: 65972



Hello!

I'm looking for some solution to apply the "best" non-clipping Album Gain (89 dB) to my collection, but there are some problems:

1. I need ID3v2.3 Tags for my Portable (Sony Network Walkman) to display Tags and Album Art correctly (which means that the APE-Tag must not be present)
2. MP3Gain supports only APEv2 and somehow removes any ID3 Tags when (Album) Gain is applied
3. without the MP3Gain-Tags the changes can't be undone

It seems MP3Gain is no longer in development, so I don't expect an ID3-Tag support. Can fb2k's "Apply ReplayGain" do the same job as MP3Gain? I could put up with that.

Besides, could someone explain the MP3Gain-Tags, please?

MP3_GAIN_UNDO (+002,+002,N)
MP3_GAIN_MINMAX (000,175)
MP3_GAIN_ALBUM_MINMAX (000,205)

The "+002,+002" means the Track & Album Gain originally was +3 dB higher (2 x 1,5 dB) and "N" means no clipping will occur when these Values are applied, the values in the other two tags are Track & Album Gain.

Am I right?
Go to the top of the page
+Quote Post
db1989
post Aug 27 2012, 21:28
Post #2





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



Green emphases and square-bracketed additions mine:
My tags ("Artist", "Title", etc.) are not working after using MP3Gain

MP3Gain stores [read: stores only] "Analysis" and "Undo" information in special tags inside the mp3 file itself. These tags are in the APEv2 format. APEv2 tags are carefully designed to not interfere with other tag formats, such as the popular ID3v1 format.

Unfortunately, some mp3 players do not strictly adhere to the ID3v1 standard when reading tags. As a result, when MP3Gain writes its APEv2 tags, these mp3 players might get confused and try to read the MP3Gain tags instead of the regular ID3v1 tags such as "Artist", "Title", etc. As a result, the player will show random garbage in these fields.

(To be fair, the mp3 players that have this problem are actually probably trying to compensate for data corruption that can occur in mp3s due to bad encoders, incomplete downloads, etc.)

If you use MP3Gain and discover that your mp3 player has this problem, then here's what you need to do:
ē Select "Options - Tags - Ignore (do not read or write tags)" from the MP3Gain menu. This will prevent MP3Gain from writing any more tags to your files.
ē To remove tags that MP3Gain has already written, simply load the affected mp3s into MP3Gain and do "Options - Tags - Remove Tags from files"


IMPORTANT
If you choose the "Options - Tags - Ignore" option, then you will not be able to automatically undo changes made by MP3Gain. You will still be able to undo any changes, but you will have to manually keep track of what changes you make to your files.

In other words, MP3Gain can normalise your files without needing to add tags at all, you can remove the tags that itís previously added, and changes can be undone as long as you have stored the reversion information in some other way.

Is that any help?

As for the format of undo info, I think youíre correct that itís that simple, but someone more in-the-know than me can confirm.
Go to the top of the page
+Quote Post
davelasker
post Aug 28 2012, 00:21
Post #3





Group: Members
Posts: 123
Joined: 1-August 04
From: San Francisco
Member No.: 15951



QUOTE (Vittorio @ Aug 27 2012, 12:12) *
could someone explain the MP3Gain-Tags, please?

MP3_GAIN_UNDO (+002,+002,N)
MP3_GAIN_MINMAX (000,175)
MP3_GAIN_ALBUM_MINMAX (000,205)

The two numbers in the UNDO tag refer to the gain applied to left and right channels that would need to be undone, in units of 1.505dB. The 'N' means the Wrap flag was not used. A 'Y' would mean the Wrap flag was used (i.e. during undo, a small amplitude should wrap around to a large number, or vice-versa).

The MINMAX values refer to the minimum and maximum amplitudes in the file. This allows MP3Gain to check for clipping without having to re-analyze audio data in the file.

Hope that helps...

Dave
Go to the top of the page
+Quote Post
Vittorio
post Aug 28 2012, 00:32
Post #4





Group: Members
Posts: 52
Joined: 25-January 09
Member No.: 65972



QUOTE (db1989 @ Aug 27 2012, 21:28) *
Green emphases and square-bracketed additions mine[...]

Thanks, but I've read the whole MP3Gain Help File (Documentation), so I already knew that.
I'd rather like to know how I should "manually keep track" of the changes If I don't understand the Tag-Code in detail?
Besides, there is no option to undo the Gain Changes without theses Tags. The only solution would be storing the original Album Gain in a Text File, set it as Target "Normal" Volume and apply Album Gain. One by one.
Just imagine how long it would take for a whole library for example.
Drag & Drop a whole library and just klick "Undo Gain Changes" is way easier, faster and more convenient.

Is there another way or does anybody know more about the MP3Gain specs?

Go to the top of the page
+Quote Post
Vittorio
post Aug 28 2012, 00:38
Post #5





Group: Members
Posts: 52
Joined: 25-January 09
Member No.: 65972



QUOTE (davelasker @ Aug 28 2012, 00:21) *
The two numbers in the UNDO tag refer to the gain applied to left and right channels that would need to be undone, in units of 1.505dB. The 'N' means the Wrap flag was not used. A 'Y' would mean the Wrap flag was used (i.e. during undo, a small amplitude should wrap around to a large number, or vice-versa).

The MINMAX values refer to the minimum and maximum amplitudes in the file. This allows MP3Gain to check for clipping without having to re-analyze audio data in the file.

Hope that helps...

Dave


Thanks, that was what I needed to know. But I don't exactly understand what the wrap flag is.

Will it be enough to store the dB-change that was made and assume the wrap flag is always "N"?
I could then write this tag back to all files with an mp3tag script for example.

This post has been edited by Vittorio: Aug 28 2012, 00:38
Go to the top of the page
+Quote Post
davelasker
post Aug 28 2012, 00:47
Post #6





Group: Members
Posts: 123
Joined: 1-August 04
From: San Francisco
Member No.: 15951



QUOTE (Vittorio @ Aug 27 2012, 16:38) *
I don't exactly understand what the wrap flag is.

Will it be enough to store the dB-change that was made and assume the wrap flag is always "N"?
I could then write this tag back to all files with an mp3tag script for example.

From a command window, run mp3gain with the /? wrap option (or -? wrap if you are on Linux or Mac). That will give you an explanation of what it is. If you never use the wrap flag, then you can safely assume it will always be "N".
Go to the top of the page
+Quote Post
shadowking
post Aug 28 2012, 03:42
Post #7





Group: Members
Posts: 1527
Joined: 31-January 04
Member No.: 11664



mp3gain /s s *.mp3
mp3gain /a /s s *.mp3

Apply gain without writing tags
Apply album gain without writing tags

Foobar will do the same as above when you scan then apply gain to MP3 data.



--------------------
Wavpack -b450s0.7
Go to the top of the page
+Quote Post
bilbo
post Aug 28 2012, 04:58
Post #8





Group: Members
Posts: 190
Joined: 16-April 07
Member No.: 42593



The easyest way would be to to copy the files to a new folder and apply mp3gain to the new files. That way you would have both.

Another option would be to copy the ape info to id3 tags and delete ape tags. This can be done simply using mp3tag From the FAQ's:

http://forums.mp3tag.de/index.php?showtopic=978#entry5136

Should you need to reverse the process copy the info from id3 to ape without deleting the id3 tag.


--------------------
Glass half full!
Go to the top of the page
+Quote Post
Vittorio
post Aug 28 2012, 11:57
Post #9





Group: Members
Posts: 52
Joined: 25-January 09
Member No.: 65972



QUOTE (shadowking @ Aug 28 2012, 03:42) *
mp3gain /s s *.mp3
mp3gain /a /s s *.mp3

Apply gain without writing tags
Apply album gain without writing tags

Foobar will do the same as above when you scan then apply gain to MP3 data.


Does foobar also consider clipping?

I'll try to experiment a little with that...
Go to the top of the page
+Quote Post
shadowking
post Aug 28 2012, 12:58
Post #10





Group: Members
Posts: 1527
Joined: 31-January 04
Member No.: 11664



QUOTE (Vittorio @ Aug 28 2012, 20:57) *
QUOTE (shadowking @ Aug 28 2012, 03:42) *
mp3gain /s s *.mp3
mp3gain /a /s s *.mp3

Apply gain without writing tags
Apply album gain without writing tags

Foobar will do the same as above when you scan then apply gain to MP3 data.


Does foobar also consider clipping?

I'll try to experiment a little with that...



Yes I think so. There is an option in playback settings that control RG. Under processing: " apply gain and prevent clipping..."

Foobar RG scanner will enable RG for 'capable audio players'.. If you go further and apply gain to mp3 data, You also enable non RG capable players to have normalized audio - at the same time you keep metadata for RG aware players giving you best of both worlds.


--------------------
Wavpack -b450s0.7
Go to the top of the page
+Quote Post
db1989
post Aug 28 2012, 14:05
Post #11





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (shadowking @ Aug 28 2012, 12:58) *
You also enable non RG capable players to have normalized audio - at the same time you keep metadata for RG aware players giving you best of both worlds.
Except when the player in question not only cannot normalise using said metadata but actively chokes on it, which is the entire point of this thread.
Go to the top of the page
+Quote Post
shadowking
post Aug 29 2012, 03:04
Post #12





Group: Members
Posts: 1527
Joined: 31-January 04
Member No.: 11664



QUOTE (db1989 @ Aug 28 2012, 23:05) *
QUOTE (shadowking @ Aug 28 2012, 12:58) *
You also enable non RG capable players to have normalized audio - at the same time you keep metadata for RG aware players giving you best of both worlds.
Except when the player in question not only cannot normalise using said metadata but actively chokes on it, which is the entire point of this thread.



RG metadata in ID3V2 and gain is altered internally. This should not be a problem for any player as the ape tag is absent using my examples. Undo is not possible but i don't really care for that anymore. If its an issue one can make a copy of the folder then use foobar PREFERENCES - ADVANCED TAGGING - MP3 - Tick id3v2 compatibility mode , then- TAGGING - MP3 TAG TYPES - tick only id3v2, Scan RG, Apply gain to MP3 data. Then transfer this folder to the Sony Walkman.

If using mp3gain only: Make a copy of desired folder(s) and use mp3gain *.mp3 /s s. Transfer modified folder to the Sony. If you wanna use a GUI the frontend has an option to turn off tag writing.

This post has been edited by shadowking: Aug 29 2012, 03:37


--------------------
Wavpack -b450s0.7
Go to the top of the page
+Quote Post
tycho
post Aug 29 2012, 17:42
Post #13





Group: Members
Posts: 345
Joined: 5-August 03
Member No.: 8183



You could use metamp3, a tool a made years ago, which scans, adds id3v2.3, or moves APE2 replaygain tags to id3v2.3 (without scanning). I haven't followed up on that project partly because it was based on the crappy id3lib. That's the only reason I didn't make the source public.

I still would like to make a proper command line tool that supports tagging for every audio format, and included replaygain scanning and mp3gain adjustment like metamp3. It is doable by using TagLib, which finally has support for id3v2.3 (earlier id3v2.4 only) - which was the reason that held me off using that software library. I doubt I will get around to do it though, as I'm already involved with translating lossyWAV to c++.

This post has been edited by tycho: Aug 29 2012, 17:43
Go to the top of the page
+Quote Post
JJZolx
post Aug 29 2012, 18:48
Post #14





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



QUOTE (tycho @ Aug 29 2012, 10:42) *
I still would like to make a proper command line tool that supports tagging for every audio format, and included replaygain scanning and mp3gain adjustment like metamp3.


Forget "every audio format". A modern tool just for Mp3/ID3 is sorely needed. The command-line syntax should mirror that of LAME 3.99, enabling tagging of any field and the embedding of any size image.

QUOTE
It is doable by using TagLib, which finally has support for id3v2.3 (earlier id3v2.4 only) - which was the reason that held me off using that software library. I doubt I will get around to do it though, as I'm already involved with translating lossyWAV to c++.


I've always thought that a tool could be derived from LAME itself, and wonder why it's never been made a part of that project. Remove the encoding and decoding ability and add ReplayGain scanning and things like tag import and export similar to metaflac.
Go to the top of the page
+Quote Post
tycho
post Aug 29 2012, 20:06
Post #15





Group: Members
Posts: 345
Joined: 5-August 03
Member No.: 8183



QUOTE (JJZolx @ Aug 29 2012, 09:48) *
Forget "every audio format". A modern tool just for Mp3/ID3 is sorely needed. The command-line syntax should mirror that of LAME 3.99, enabling tagging of any field and the embedding of any size image.

Well, with TagLib you basically get tagging of all important audio formats for "free". Even if you're not a programmer, you can see that the short example program taken from taglib is very powerful. It prints out meta-tags and audio property from any audio file format supported.
CODE
int main(int argc, char *argv[])
{
  int i;
  int seconds;
  int minutes;
  TagLib_File *file;
  TagLib_Tag *tag;
  const TagLib_AudioProperties *properties;

  taglib_set_strings_unicode(FALSE);

  for(i = 1; i < argc; i++) {

    file = taglib_file_new(argv[i]);

    if(file == NULL)
      break;
    tag = taglib_file_tag(file);
    properties = taglib_file_audioproperties(file);

    if(tag != NULL) {
      printf("-- TAG --\n");
      printf("title   - \"%s\"\n", taglib_tag_title(tag));
      printf("artist  - \"%s\"\n", taglib_tag_artist(tag));
      printf("album   - \"%s\"\n", taglib_tag_album(tag));
      printf("year    - \"%i\"\n", taglib_tag_year(tag));
      printf("comment - \"%s\"\n", taglib_tag_comment(tag));
      printf("track   - \"%i\"\n", taglib_tag_track(tag));
      printf("genre   - \"%s\"\n", taglib_tag_genre(tag));
    }
    if(properties != NULL) {
      seconds = taglib_audioproperties_length(properties) % 60;
      minutes = (taglib_audioproperties_length(properties) - seconds) / 60;

      printf("-- AUDIO --\n");
      printf("bitrate     - %i\n", taglib_audioproperties_bitrate(properties));
      printf("sample rate - %i\n", taglib_audioproperties_samplerate(properties));
      printf("channels    - %i\n", taglib_audioproperties_channels(properties));
      printf("length      - %i:%02i\n", minutes, seconds);
    }
    taglib_tag_free_strings();
    taglib_file_free(file);
  }
  return 0;
}

QUOTE
I've always thought that a tool could be derived from LAME itself, and wonder why it's never been made a part of that project. Remove the encoding and decoding ability and add ReplayGain scanning and things like tag import and export similar to metaflac.

I suppose it could (but only for mp3) as it contains both tagging and replaygain code, but I'd say it's easier to add mp3gain/wavegain code with the above.
Go to the top of the page
+Quote Post

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: 22nd September 2014 - 06:09