bbc / bmx

Library and utilities to read and write broadcasting media files. Primarily supports the MXF file format
BSD 3-Clause "New" or "Revised" License
62 stars 17 forks source link

Increase KLV Fill margin at end of header partition #43

Closed philipnbbc closed 1 year ago

philipnbbc commented 1 year ago

Updates to the header metadata when completing the write was found to consume more than 256 bytes, the original margin on top of the target KLV Fill size. This caused file validation failures. This commit changes the margin to 8K.

Fixes https://github.com/bbc/bmx/issues/37

thomasheritage commented 1 year ago

Perhaps it makes sense for @matthewmarks-bbc to review this PR too?

It would be good to test that IMF Track Files made with this update have a KLV Fill at the end of the Header Partition where the "data" of the KLV Fill item is at least 8192 bytes in length.

Matthew-Marks commented 1 year ago

MXF Explorer: "Pack #15" is "Fill Item"; next Pack is "Body partition". For VIDEO_33b68ff0-b42c-400f-ba1c-5d2288bfcf05.mxf (the ABCD123E_03 Video Track File), the length of this is 8027. Same if transwrapped with existing executable.

The Baton report says "KLVFill after header partition is 7.86 KB. It should be at least 8 KB as per specification".

8027/1024 = 7.84 which tallies with this - "KB" must mean kiB.

If created using proposed raw2bmx it is 15902; if created using proposed bmxtranswrap, it is 15940. This is 15.5 kiB.

Therefore the file is now compliant.