mp3durationexiftoolid3-tag

exiftool shows incorrect Duration for MP3. How does that happen?


Downloaded seven MP3 files from a website. exiftool says the Duration is two minutes.

Opened it in an audio editor and find that it is actually four minutes.

Opened a (non-downloaded) MP3 file in the same editor, duration different from two or four.

Copied all audio from the downloaded file and pasted over the other audio. Editor shows the other changing to four minutes.

exiftool shows the second file has a duration of four minutes.

Same behavior (different numbers) for the other six downloaded files. First one is the only one where the difference was approximately a factor of two (so it's not stereo vs. mono)

Is Duration an ID3 tag that can be falsified, as opposed to being measured from the actual audio?


Solution

  • There should be an (approx) in the exiftool output after the Duration value. Duration is not an embedded tag, it's a value that's calculated on the fly by exiftool. If you add the -G (-groupNames) option to your command, you'll see that it is part of the Composite tag group. If you check the listing there, you'll see the tags that exiftool uses to calculate the Duration. It's most likely the group that includes ID3Size and MPEG:AudioBitrate.

    Exiftool doesn't read and parse the stream data, which the audio editor will do and get a more accurate result. Odds are there is something incorrect about the header for your file.

    Related post on the exiftool forums.