I've been scratching my head to why exiftool reports a different wav file duration than the actual length. I work in Pro Tools on Mac and deliver stereo wav files (mostly 48/16) to a server that uses exiftool to calculate the wav file duration and length calculated by exiftool is longer than the actual file.
Created a ticket with AVID and they now told me that this problem needs to be fixed by exiftool and wrote me this:
Hi,
Our Engineering team has reviewed the issue and came to the conclusion that it needs to be fixed by Exiftool. They should use the size of the "data" chunk to calculate the duration of the file properly.
I will now close this case. If you have any further questions on this matter, please reply to this email to re-open the case.
Kind regards,
Avid Customer Care | Audio
It might be this, though that was for MP3 files. Depends upon what encoding was used for the wav file
Bug: Approximate duration doubled on mp3 files
(https://github.com/exiftool/exiftool/issues/160#issuecomment-1293946184)
QuoteExifTool doesn't analyze the whole stream, and just calculates an approximate duration from the header information
ffmpeg is probably a better choice if you need the exact duration.
Can you send me a sample WAV file that reports an incorrect duration? My email is philharvey66 at gmail.com
- Phil
Sent with wetransfer!
WAV file 16/48 reported length by macOS 01:30:00 (90mins)
while exiftool duration says 90:43 mins.
I got the file, thanks.
I will add a patch to ExifTool 13.26 to improve the Duration calculation for this type of file.
- Phil
Wonderful! I will tell the server admin to update when it's released. Do you mind sharing some insight to what's special with the Pro Tools files? I've encountered problems like white noise with files rendered with Pro Tools and people have said things like:
"Pro Tools seems to add a chunk at the end of the wav file, it has a strange label and an impossible size indicated."
"Since our prior contact we've further confirmed - this is a bug in Pro Tools that's breaking our audio files by modifying them, when their app is parsing the WAV file's metadata.
We've worked with Avid to confirm the problem, which they've designated as bug PT-271506. If you can recover the original files from a backup that'll be a good first step."
Thanks again!
This Pro Tools sample file contained a very large (8.2 MB) 'DGDA' chunk containing strings like "AnalysisSets" and "PacketStream". It looks like proprietary Pro Tools information and not any sort of bug. This accounts for most of the extra duration as calculated by ExifTool 13.25. There are a few other smaller Pro Tools chunks as well.
- Phil
Version 13.26 is now available.
- Phil
That's.. incredible! Thank you! :)