Mp3 duration very big (and very small)

Started by pkar, July 01, 2017, 04:11:42 PM

Previous topic - Next topic

pkar

I got somewhat strange output from Exiftool

ExifTool Version Number         : 10.57
Windows Server 2012 standard

Command line: exiftool exif01.mp3

Duration                        : -2052707296
File accessible here: http://beskid.geo.uj.edu.pl/p/exif01.mp3

Duration                        : 2031990000
File accessible here: http://beskid.geo.uj.edu.pl/p/exif02.mp3

Seems unrealistic, especially first file, with minus sign :)
WinAmp 5.5 (yes, I'm using such antique version) shows correct time.

Phil Harvey

Well, ExifTool is reporting the actual duration string stored in the APE metadata:

  | 0)  Duration = -2052707296
  |     - Tag 'DURATION' (11 bytes):
  |       522831: 2d 32 30 35 32 37 30 37 32 39 36                [-2052707296]


However, if I interpret this as an unsigned 4-byte integer then I get the correct duration in units of 100 ns.

I'll add a conversion for this tag.

Thanks for the report.

- 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 ($).

pkar

It is easier to spot error than to write software :)

I just scanned all my music (over 70 thousands...) using exiftool and place metadata in SQL database (of course by script. not by hand). And suddenly, when I use
SELECT COUNT(*), SUM(duration) FROM ...
I get "Arithmetic overflow" :)