sandflow / regxmllib

Convert MXF to XML: RegXML (SMPTE ST 2001-1) tools and libraries
BSD 2-Clause "Simplified" License
35 stars 14 forks source link

KLV Fill between the Header Partition Pack and the Primer Pack causes an exception #26

Closed thomasheritage closed 9 years ago

thomasheritage commented 9 years ago

I assume (from looking at various MXF files I've tried) that's the cause of this output:

No Primer Pack found
Exception in thread "main" java.lang.NullPointerException
        at com.sandflow.smpte.klv.LocalSet.fromTriplet(LocalSet.java:113)
        at com.sandflow.smpte.tools.RegXMLDump.main(RegXMLDump.java:176)

This situation is permitted by ST 377-1:2011 Section 9.1. Note that in this MXF file it is a "legacy" KLV Fill key that is used (for KLV Fill byte 8 of the Key needs to be ignored).

I think that KLV Fill bytes not being correctly counted is probably also causing the following warning on a different MXF file:

WARNING: Index Table Segment encountered before Header Byte Count bytes read.

ST 377-1:2011 Section 9.1 notes that the KLV Fill at the end of the Header Metadata is included in the value of HeaderByteCount

palemieux commented 9 years ago

Changeset aac5f560ff84bd9f39c07b75fc041bc000ebf24f should have fixed this. Can you confirm?

thomasheritage commented 9 years ago

Those error messages I reported were from an older version of the code.

These are the outputs I now get when running aac5f (14 Jan):

For AS11_DPP_HD_EXAMPLE_1.mxf

Jan 20, 2015 6:42:45 PM com.sandflow.smpte.tools.RegXMLDump main
WARNING: Failed to read Group: urn:smpte:ul:060e2b34.01010102.03010210.01000000

This is the KLV Fill key so should just be skipped

For AS11_DPP_SD_EXAMPLE_1.mxf

No Primer Pack found
Jan 20, 2015 7:02:46 PM com.sandflow.smpte.tools.RegXMLDump main
WARNING: Failed to read Group: urn:smpte:ul:060e2b34.02050101.0d010201.01050100
Exception in thread "main" java.lang.NullPointerException
        at com.sandflow.smpte.klv.LocalSet.fromTriplet(LocalSet.java:113)
        at com.sandflow.smpte.tools.RegXMLDump.main(RegXMLDump.java:179)

I'll email details of how you can obtain these MXF files. I suspect the SD issue is to do with KLV Fill between the Header Partition Pack and the Primer Pack.

palemieux commented 9 years ago

It looks like the Filler Item UL was incorrectly specified in the code as

urn:smpte:ul:060e2b34.01010102.03010220.01000000

instead of

urn:smpte:ul:060e2b34.01010102.03010210.01000000
thomasheritage commented 9 years ago

Now using later code (159d926). Both MXF files successfully dumped. However, I still get:

For SD:

Jan 20, 2015 7:39:57 PM com.sandflow.smpte.tools.RegXMLDump main
WARNING: Failed to read Group: urn:smpte:ul:060e2b34.01010101.03010210.01000000

and for HD:

Jan 20, 2015 7:38:50 PM com.sandflow.smpte.tools.RegXMLDump main
WARNING: Failed to read Group: urn:smpte:ul:060e2b34.01010102.03010210.01000000
thomasheritage commented 9 years ago

34efd99 seems to fix this issue