M4A file identification

Started by robinfriedli, June 11, 2024, 06:49:42 PM

Previous topic - Next topic

robinfriedli

I was wondering how exiftool recognizes M4A files because I'm getting some inconsistent result where some of them get identified as MP4 files (so video/mp4 instead of audio/mp4 despite being audio files).

curl -s https://filebroker.io/api/get-object/c432752a-d6c4-47ea-96a4-8f86974d5b76.m4a | exiftool -j --struct -fast2 -api largefilesupport=1 - correctly identifies as M4A (FileType M4A and MIMEType audio/mp4).

curl -s https://filebroker.io/api/get-object/7b2bb160-417a-4cf2-88ac-b40c1fa2921d.m4a | exiftool -j --struct -fast2 -api largefilesupport=1 - However exiftool shows this one as FileType MP4 and MIMEType video/mp4

The main difference is that the first of them is an iTunes music file and the other one isn't. Both have a cover art video stream shown by ffprobe, though the first is mjepg and the second is png. I've checked mdls and both files are shown with kMDItemKind "Apple MPEG-4 audio"

Phil Harvey

ExifTool looks at the MajorBrand identification in the 'ftyp' box.  For these 2 files:

> exiftool *.m4a -p '$majorbrand# - $majorbrand'
M4A  - Apple iTunes AAC-LC (.M4A) Audio
mp42 - MP4 v2 [ISO 14496-14]

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