Odd metadata problem with music (MP3) files

Started by cjsmall, May 21, 2021, 10:56:39 PM

Previous topic - Next topic

cjsmall

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:

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:

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

Is there any change if you add -G1 -A to your command?
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

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

cjsmall

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:

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:

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:

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

Linked files

exiftool text output
http://cjsa.com/misc/01_Before_exif
http://cjsa.com/misc/01_After_exif
http://cjsa.com/misc/02_Before_exif
http://cjsa.com/misc/02_After_exif
http://cjsa.com/misc/03_Before_exif
http://cjsa.com/misc/03_After_exif

Files
http://cjsa.com/misc/01_Before.mp3
http://cjsa.com/misc/01_After.mp3
http://cjsa.com/misc/02_Before.mp3
http://cjsa.com/misc/02_After.mp3
http://cjsa.com/misc/03_Before.mp3
http://cjsa.com/misc/03_After.mp3
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

cjsmall

StarGeek, thanks for fixing the links.  Sorry about that.  Something went wrong in the cut/paste!

StarGeek

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.
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                        : -


* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

cjsmall

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

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?

Phil Harvey

Sorry for dropping the ball on this one.  There is a problem with ExifTool reading the ID3v2 extended header.  I'll fix this in ExifTool 12.46.

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

cjsmall

Phil, thanks for addressing this.

I recently upgraded from Xubuntu 20.04 to 22.04.1 but I see that version 12.40 is still the active package in the repository.  I'm not sure who is responsible for maintaining the package, but could the most recent updates be pushed out?

Phil Harvey

You will have to appeal to the package manager.  I don't have anything to do with that.

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

StarGeek

You can always just download the latest version and extract it right on top of the old version.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).