MediaArea / MediaInfoLib

Convenient unified display of the most relevant technical and tag data for video and audio files.
https://mediaarea.net/MediaInfo
BSD 2-Clause "Simplified" License
636 stars 175 forks source link

MediaInfo incorrectly re-grouping certain MP3 tags #1795

Open mikecappella opened 1 year ago

mikecappella commented 1 year ago

MediaInfo is incorrectly re-packaging some MP3 user tags, and this can cause not only duplicate tags in, for example, JSON or XML output, but it is losing some tag values.

Here's one of the identically named Biography groupings, for example:

               "Biography" : {
                  "URL" : "https://www.allmusic.com/artist/mn0000788138/biography",
                  "short" : "A highly successful record label boss, he signed some huge names from the late 60s through to the 90s."
               },

But the actual tags are, as output by exiftool:

  | UserDefinedText = (AMG Artist Biography) With their heavily orchestrated, sweet bal[snip]
  | UserDefinedText = (AMG Artist Biography (short)) Mellow Australian soft rock group [snip]
  | UserDefinedText = (AMG Artist Biography URL) https://www.allmusic.com/artist/mn0000[snip]
  | UserDefinedText = (AMG Composer Biography) A Harvard Law School graduate, Clive Dav[snip]
  | UserDefinedText = (AMG Composer Biography (short)) A highly successful record label[snip]
  | UserDefinedText = (AMG Composer Biography URL) https://www.allmusic.com/artist/mn00[snip]

Note that the value of "AMG Composer Biography" is lost - only the URL and short values are output. E.g. AMG Composer Biography (short) and AMG Composer Biography URL.

Second, duplicate "Biography" JSON / XML groupings are created.

It seems MediaInfo is latching onto only the "Biography" portion of the full tag "AMG Artist Biography" or "AMG Composer Biography", creating two identically-named Biography containers and placing the "URL" and "short" values within. This is entirely wrong, and breaks parsing the JSON or XML due to duplicate tags (e.g. "Biography").

This is occurring with several tags, seemingly because their names share a common root prefix. In the case of the two Biography variants, MediaInfo seems to think the Artist Biography and Composer Biography are identical. This is incorrect.

JeromeMartinez commented 1 year ago

Please a sample file (no need of the audio content, only the ID3v2 part).

mikecappella commented 1 year ago

test.mp3.zip

This is a 2 second silent mp3 w/tags.

JeromeMartinez commented 1 year ago

Wow, huge count of tags, thank you. We'll handle that when we have free time (don't expect soon, this part of the code is messy and with lot of stuff for trying to aggregate correctly different sources).

mikecappella commented 1 year ago

Yes, indeed.

No hurry. I discovered it accidentally while testing some of my own code that calls the MediaInfo CLI, used primary for video files.