Author Topic: Odd metadata problem with music (MP3) files  (Read 3023 times)

cjsmall

  • Newbie
  • *
  • Posts: 6
Odd metadata problem with music (MP3) files
« on: May 21, 2021, 10:56:39 PM »
I'm on Xubuntu 20.04 using exiftool 11.88

I've been using exiftool to extract tags from my MP3 files.  Here is the command that I use:

exiftool -m -f -Artist -Band -Album -Title -Track -Year -Genre -Composer -Duration -AudioBitrate "<filename>.mp3"

Works fine.  I've been editing some file with the Audacity audio editor.  When the file is saved it appears that some tags are lost.  For example,  here is the output of a music file before editing:

Code: [Select]
Artist      : Withers, Bill
Band        : Withers, Bill
Album       : Lean on Me: The Best of Bill Withers
Title       : Lean On Me
Track       : 2
Year        : 1994
Genre       : Soul
Composer    : Withers, Bill
Duration    : 0:04:18 (approx)
Bitrate     : 241 kbps
Rating      : 4

But after saving the edited file:

Code: [Select]
Artist      : Withers, Bill
Band        : -
Album       : Lean on Me: The Best of Bill Withers
Title       : Lean On Me
Track       : -
Year        : -
Genre       : Soul
Composer    : -
Duration    : 0:04:18 (approx)
Bitrate     : 206 kbps

It sees that Band, Track, Year, Composer and Rating are lost.

However, when the revised MP3 is loaded into a new Audacity session, the tags are visible in its metadata editor as seen in the following link.

http://smallthoughts.com/photos/misc/audacity_01.png

Any clue what is going on?  Is Audacity writing out the tags in a format that it can recognize but which exiftool cannot?  How can we track down what is happening?  I've seen similar things with a few other editors losing metadata.  The GIMP photo editor is one example.  Maybe there is a common problem here.

Suggestions?

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 5241
Re: Odd metadata problem with music (MP3) files
« Reply #1 on: May 21, 2021, 11:08:18 PM »
Is there any change if you add -G1 -A to your command?
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18253
    • ExifTool Home Page
Re: Odd metadata problem with music (MP3) files
« Reply #2 on: May 22, 2021, 07:52:05 AM »
Could you post a small sample?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

cjsmall

  • Newbie
  • *
  • Posts: 6
Re: Odd metadata problem with music (MP3) files
« Reply #3 on: May 22, 2021, 01:13:24 PM »
I tried the  -G1 -A  flags and that made no difference.

To create some sample files, I tried a couple of very short music files which I named 01_Before.mp3 and 02_Before.mp3 along with another longer music (03_Before.mp3) file I had been using for testing and which I reported on above.  File 03_After.mp3 never reported any exiftool errors, but when accessing the metadata for the two smaller files, exiftool reports:

Code: [Select]
Warning: Invalid ID3 frame size - After.mp3
Warning: Invalid ID3 frame size - After.mp3
Warning: Invalid ID3 frame size - After.mp3

and the output is as follows:

Code: [Select]
Artist      : -
Band        : -
Album       : -
Title       : -
Track       : -
Year        : -
Genre       : -
Composer    : -
Duration    : 0:01:32 (approx)
Bitrate     : 206 kbps

So all the data appears to be missing, yet it all displays when reloaded into Audacity.

I tried to attach the music file samples but there was an error about some being too large.  I've placed the following files:

Code: [Select]
01_After.mp3
01_After_exif
01_Before.mp3
01_Before_exif
02_After.mp3
02_After_exif
02_Before.mp3
02_Before_exif
03_After.mp3
03_After_exif
03_Before.mp3
03_Before_exif

under the directory: http://cjsa.com/misc/After.mp3/  The directory itself is not readable, but you should be able to open/download and or all of these files by appending the name to the url.

I hope this helps.

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 5241
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

cjsmall

  • Newbie
  • *
  • Posts: 6
Re: Odd metadata problem with music (MP3) files
« Reply #5 on: May 24, 2021, 02:33:18 PM »
StarGeek, thanks for fixing the links.  Sorry about that.  Something went wrong in the cut/paste!

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 5241
Re: Odd metadata problem with music (MP3) files
« Reply #6 on: May 25, 2021, 12:51:43 PM »
My guess is that there is a bug in your version of Audacity.  Exiftool produces two warnings from that file
Warning                         : Error inflating unknown frame
Warning                         : Invalid ID3 frame size


I have Audacity 3.02 installed, loaded and exported your before file (attached below), and it appears to fix those two bugs, but add a new one.  More of your data will appear, but still not all and Duration is lost.
Code: [Select]
C:\>exiftool -g1 -a -s -e  -warning Y:\!temp\bb\01_newafter.mp3 -Artist -Band -Album -Title -Track -Year -Genre -Composer -Duration -AudioBitrate -f
---- MPEG ----
AudioBitrate                    : 128 kbps
---- ID3v2_3 ----
Title                           : Golden Slumbers
Track                           : 14
Album                           : Abbey Road
Year                            : 1969
Genre                           : Rock
Artist                          : Beatles, The
---- ExifTool ----
Warning                         : [minor] Frame 'TDRC' is not valid for this ID3 version
----  ----
Band                            : -
Composer                        : -
Duration                        : -

Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

cjsmall

  • Newbie
  • *
  • Posts: 6
Re: Odd metadata problem with music (MP3) files
« Reply #7 on: May 31, 2021, 06:25:34 PM »
StarGeek, thanks for checking against a later version of Audacity.  I've been using version 2.3.3 which is the latest in the Ubuntu repository.

I'm going to check the Audacity source and see what library is being used to read/write the metadata.  Is there any way to see what is triggering these exiftool errors and warnings?  I'm still confused that Audacity is able to reopen the previously written music files and reports the fields that exiftool is unable to read.

cjsmall

  • Newbie
  • *
  • Posts: 6
Re: Odd metadata problem with music (MP3) files
« Reply #8 on: May 31, 2021, 07:10:38 PM »
If it of any use, Audacity appears to be using the libid3tag library to read/write tags.  Has there ever been an incompatibility see between this library and exiftool?