Menu

#28 previous id3v2 tags messed up?

open
nobody
None
5
2014-08-26
2009-08-11
No

I'm doing some experiments with mp3gain (1.5.1) on linux platform.
Basically, I'm playng with id3v2 and I've noticed this behaviour:

$ id3v2 -l layla.mp3
id3v1 tag info for layla.mp3:
Title : Layla -(Unplugged) Artist: Eric Clapton
Album : Complete Clapton Year: 2007, Genre: Unknown (255)
Comment: Track: 28
id3v2 tag info for layla.mp3:
TPE1 (Lead performer(s)/Soloist(s)): Eric Clapton
TIT2 (Title/songname/content description): Layla -(Unplugged)
TALB (Album/Movie/Show title): Complete Clapton
TYER (Year): 2007
TRCK (Track number/Position in set): 28
APIC (Attached picture): ()[, 3]: image/jpeg, 13958 bytes
TXXX (User defined text information): (Tagging time): 2009-06-06T22:49:44

Now, using mp3gain on this file:

$ mp3gain -s i layla.mp3
layla.mp3
Recommended "Track" dB change: -6.020000
Recommended "Track" mp3 gain change: -4
Max PCM sample at current gain: 36859.510784
Max mp3 global gain field: 190
Min mp3 global gain field: 141

Recommended "Album" dB change for all files: -6.020000
Recommended "Album" mp3 gain change for all files: -4

But now id3v2 is not so happy:

$ id3v2 -l layla.mp3
id3v1 tag info for layla.mp3:
Title : Layla -(Unplugged) Artist: Eric Clapton
Album : Complete Clapton Year: 2007, Genre: Unknown (255)
Comment: Track: 28

Is there something going wrong with mp3gain tagging or with id3v2 command? The idea to lose id3v2 tags is not so appealing :)

Thanks for any answer.

Discussion

  • Nobody/Anonymous

    Maybe I've got the problem, even if I'm not sure: mp3gain changes id from v2.3.0 to 2.4.0 and some libs/utilities cannot cope with id3 v2.4.0 yet... I'll look better into this.

     
  • Jim Avera

    Jim Avera - 2014-08-26

    It's not just id3v2.

    The Perl library MP3::Tag gives an "unknown frame format" error and returns corrupted/undef results when trying to read tags after running
    mp3gain -s i file.mp3.

    So mp3gain must be doing something which confuses at least some ID3v2-aware software. I'm using mp3gain v1.5.2 on Ubuntu linux.

    Here is a demo script:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    #!/usr/bin/perl
    use strict; use warnings;
    use MP3::Tag;
    
    sub dump_tags($) {
      my ($path) = @_;
      my $mp3 = MP3::Tag->new($path) or die "new error on $path";
      $mp3->get_tags;
      if (defined (my $id3v2=$mp3->{ID3v2})) {
        my $hash = $mp3->get_id3v2_frame_ids;
        while (my ($frame, $desc) = each %$hash) {
          my ($desc2, @list) = $id3v2->get_frames($frame);
          print "$desc => (@list)\n";
        }
      }
      $mp3->close();
    }
    
    my $original = "/tmp/t.mp3";
    my $copy     = "/tmp/temp.mp3";
    system("set -x; cp $original $copy")==0 or die "cp failed";
    
    print "BEFORE:\n";
    dump_tags($copy);
    
    print "RUNNING mp3gain ...\n";
    system("set -x; mp3gain -s i $copy")==0 or die "mp3gain failed";
    
    print "AFTER:\n";
    dump_tags($copy);  # this one gets many errors!
    
    exit 0;
    
     

    Last edit: Jim Avera 2014-08-26

Log in to post a comment.