ExifTool > Bug Reports / Feature Requests

Bug: wrong BeatsPerMinute data type in MP4

(1/1)

dae65:
ExifTool 12.03 writes the QuickTime ItemList BeatsPerMinute tag as a 16-bit unsigned integer. This seems to be a bug. I believe it should be a signed integer instead.

Apple iTunes (12.06) and AtomicParsley (0.9.6) don't read ilst.tmpo atoms as written by ExifTool (12.03), although ExifTool reads it as written by them.

There is a comment to Image::ExifTool::QuickTime saying that tmpo is an int16u in your sample:

--- Code: ---%Image::ExifTool::QuickTime::ItemList = (
[...]
    tmpo => {
        Name => 'BeatsPerMinute',
        Format => 'int16u', # marked as boolean but really int16u in my sample
    },

--- End code ---

But, as an int16u, iTunes and AtomicParsley ignore it. See bpm on this screenshot for iTunes, and this for AtomicParsley:

--- Code: ---$ exiftool -ItemList:BeatsPerMinute=100 exiftool.m4a
    1 image files updated
$ AtomicParsley exiftool.m4a -t | grep -w tmpo
$

--- End code ---

But if we change the Format key to int16s, then they're able to read it. See another screenshot for iTunes and this for AtomicParsley:

--- Code: ---$ exiftool -ItemList:BeatsPerMinute=100 exiftool.m4a
    1 image files updated
$ AtomicParsley exiftool.m4a -t | grep -w tmpo
Atom "tmpo" contains: 100

--- End code ---

A tmpo.data atom edited with ExifTool 12.03 comes with a 0x16 data-type flag:


--- Code: ---$ hexdump -C -s 77134 -n 26 exiftool.m4a
00012d4e  00 00 00 1a 74 6d 70 6f  00 00 00 12 64 61 74 61  |....tmpo....data|
00012d5e  00 00 00 16 00 00 55 c4  00 64                    |......U..d|
00012d68

--- End code ---

But a tmpo.data atom edited with either iTunes or AtomicParsley comes with a 0x15 data-type flag:


--- Code: ---$ hexdump -C -s 77129 -n 26 itunes.m4a
00012d49  00 00 00 1a 74 6d 70 6f  00 00 00 12 64 61 74 61  |....tmpo....data|
00012d59  00 00 00 15 00 00 00 00  00 64                    |.........d|
00012d63

$ hexdump -C -s 78843 -n 26 atomicparsley.m4a
000133fb  00 00 00 1a 74 6d 70 6f  00 00 00 12 64 61 74 61  |....tmpo....data|
0001340b  00 00 00 15 00 00 00 00  00 64                    |.........d|
00013415

--- End code ---

0x15 (21) is a signed, 0x16 (22) is an unsigned, integer (QuickTime specification).

Finally, here and here is the code showing that AtomicParsley writes tmpo as a signed integer.

Thank you. :)

Phil Harvey:
Great, thanks.  I'll patch this in ExifTool 12.04

- Phil

P.S.  I would like to see a negative beats per minute!  And brain-dead software that won't read something because it isn't the expected format really bugs me (you eventually get into the situation where one piece of software will only read a tag written in format X, while another requires format Y).

dae65:

--- Quote from: Phil Harvey on August 05, 2020, 05:24:49 PM ---P.S.  I would like to see a negative beats per minute!

--- End quote ---

 ;D you've just given me an idea.

dae65:
Phil,

Other integer QuickTime tags such as Compilation have the same signed/unsigned data-type issue. I will report in another thread soon.

d

Navigation

[0] Message Index

Go to full version