freeMXF.org

Open discussion about freeMXF.org tools and MXF in general
It is currently Fri Nov 01, 2024 12:39 am
Board index » MXF Categories » freeMXF.org Tools



Post new topic Reply to topic  [ 2 posts ] 
Author
Search for:
Message

Offline
Board User

Joined: Fri Feb 12, 2010 8:28 am
Posts: 6

Post Posted: Thu Apr 29, 2010 9:57 am 
Top  
While adding functionality for exporting and importing DMS-1 metadata to our application I came across a rather peculiar behaviour which I'm unsure if it's due to my dictionary not having been written entirely correct or if it's a problem with MXFLib. I'd wager the former.

I have written my own bare-minimum DMS-1 dictionary that manages to capture all previously dark metadata in one of our example files. I have MXFLib parse the library and the input file and then traverse the resulting MDObject tree for the tracks we are interested in, and output that as an XML document. That document can be modified and imported later.

The problem is that some strong references won't work if the document is imported after the program has been restarted. More specifically, strongrefs in UUID subVectors cause a problem. This seems to be due to MXFLib expecting a UL for the UUIDs themselves, even though SMPTE 380M has no such ULs defined (as far as I can see).

For example, here's a part of the output from two separate metadata extraction runs. Note that referenceUl differ quite a bit. It is extracted by simply calling MDObject::GetUL() on the reference itself and putting the result in the XML.
Code:
...
<child name="DMS1TitlesSets" ul="060E2B34010101050601010405400400">
    <strongReference instanceUid="6292E6BCCC0E73109CF700E0008E0B14" name="DMS1Titles" referenceUl="8B7C75DD44EDA0C039402BC0BE8348E0" ul="060E2B34025301010D01040101100100">
        <leaf name="DMS1MainTitle" ul="060E2B34010101030105020100000000">
            <stringValue>The Material eXchange Format - Pro-MPEG Forum MXF Promotional Video.</stringValue>
        </leaf>
    </strongReference>
</child>
...

Code:
...
<child name="DMS1TitlesSets" ul="060E2B34010101050601010405400400">
    <strongReference instanceUid="6292E6BCCC0E73109CF700E0008E0B14" name="DMS1Titles" referenceUl="B6F49486183883EBDBDF8165559347CF" ul="060E2B34025301010D01040101100100">
        <leaf name="DMS1MainTitle" ul="060E2B34010101030105020100000000">
            <stringValue>The Material eXchange Format - Pro-MPEG Forum MXF Promotional Video.</stringValue>
        </leaf>
    </strongReference>
</child>
...

The following code snippet hopefully sums up the way these strongReference elements are handled in the code:
Code:
ULPtr ul = hexBinaryToULPtr(strongReference->ul);
ULPtr referenceUl = hexBinaryToULPtr(strongReference->referenceUl);

MDObjectPtr targetChild = new MDObject(ul);

target->AddChild(referenceUl)->MakeRef(targetChild);
appendDMS1Children(strongReference, targetChild); //recurse

Now, when I try to import the first of the above examples into a new MXF file the following errors occur:
Code:
Attempting to reference DMS1Titles from Unknown {39402bc0-be83-48e0-8b7c-75dd44eda0c0} (which is not a reference source)
Attempting to reference DMS1Annotation from Unknown {6815efb3-9c9e-4176-abf2-9c23d801e6e8} (which is not a reference source)
Attempting to reference DMS1Participant from Unknown {5c21e84f-a7de-49ad-a6bb-103e0e9504f5} (which is not a reference source)
...

That Unknown UL referencing DMS1Titles clearly matches the referenceUl in the first example.
Finally, In order to fix this issue I went ahead and made up some globalKeys for the UUIDs themselves. In this case 060e2b34.0101.0105.06010104.05400401 (DMS1Titles UL + 1). This resulted in the following metadata instead, which is stable across separate runs. It is also perfectly fine for exporting and importing:
Code:
...
<child name="DMS1TitlesSets" ul="060E2B34010101050601010405400400">
    <strongReference instanceUid="6292E6BCCC0E73109CF700E0008E0B14" name="DMS1Titles" referenceUl="060E2B34010101050601010405400401" ul="060E2B34025301010D01040101100100">
        <leaf name="DMS1MainTitle" ul="060E2B34010101030105020100000000">
            <stringValue>The Material eXchange Format - Pro-MPEG Forum MXF Promotional Video.</stringValue>
        </leaf>
    </strongReference>
</child>
...

That should be sufficient background information. What I'm wondering is then:

Is my way of inserting strong references correct? I've seen more than one variant in the example code, which differ whether AddChild() is given a UL or not, like so:
Code:
target->AddChild(referenceUl)->MakeRef(targetChild);

versus
Code:
target->AddChild()->MakeRef(targetChild);

Using the latter method unfortunately results in strange behaviour:
Code:
Attempting to reference DMS1ContactsList from DMS1TitlesSets (which is not a reference source)
Malformed batch found in DMS1TitlesSets at 0x00000000 in memory buffer - item size = 2748926090, count = 2920332984, but bytes = 8
...

Finally, does my proto-DMS-1 dictionary look OK? If not, do you have any suggestions, or is there an XML for that floating around somewhere that we could use? I'll dump the entire dictionary in the next post.

 Profile  

Offline
Board User

Joined: Fri Feb 12, 2010 8:28 am
Posts: 6

Post Posted: Thu Apr 29, 2010 10:00 am 
Top  
Here's our dms1.xml. It's obviously not very complete yet, since I'm still sorting all this out:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- See SMPTE 380M -->
<MXFDictionary>
    <MXFClasses>
        <!-- See table 3 on page 11 -->
        <DMS1ProductionFramework key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 01 01 00" base="DM_Framework">
            <!-- See annex A1 on page 14-15 -->
            <DMS1FrameworkExtendedTextLanguageCode type="ISO7String" key="80.1d" minLength="0" maxLength="12" globalKey="060e2b34.0101.0107.03010102.02130000"/>
            <DMS1TitlesSets            type="subVector" key="80.11" globalKey="060e2b34.0101.0105.06010104.05400400" use="optional" ref="strong" target="DMS1Titles">
                <DMS1Titles             type="UUID" minLength="16" maxLength="16" globalKey="060e2b34.0101.0105.06010104.05400401"/> <!-- <------ one of the made up ULs -->
            </DMS1TitlesSets>
            <DMS1AnnotationSets        type="subVector" key="80.18" globalKey="060e2b34.0101.0105.06010104.05400d00" use="optional" ref="strong" target="DMS1Annotation">
                <DMS1Annotation         type="UUID" minLength="16" maxLength="16" globalKey="060e2b34.0101.0105.06010104.05400d01"/>
            </DMS1AnnotationSets>
            <DMS1ParticipantSets       type="subVector" key="80.1a" globalKey="060e2b34.0101.0105.06010104.05401300" use="optional" ref="strong" target="DMS1Participant">
                <DMS1Participant        type="UUID" minLength="16" maxLength="16" globalKey="060e2b34.0101.0105.06010104.05401301"/>
            </DMS1ParticipantSets>
            <DMS1ContactsList       type="UUID" minLength="16" maxLength="16" key="80.0f" globalKey="060e2b34.0101.0105.06010104.02402200" ref="strong" target="DMS1ContactsList"/>
        </DMS1ProductionFramework>
        <DMS1ClipFramework       key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 01 02 00" base="DM_Framework"/>
        <DMS1SceneFramework      key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 01 03 00" base="DM_Framework"/>
        <DMS1Titles              key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 10 01 00" base="DM_Set">
            <!-- See annex A4 on page 18 -->
            <DMS1MainTitle             type="UTF16String" key="80.24" globalKey="060e2b34.0101.0103.01050201.00000000"/>
        </DMS1Titles>
        <DMS1Identification      key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 11 01 00" base="DM_Set"/>
        <DMS1GroupRelationship   key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 12 01 00" base="DM_Set"/>
        <DMS1Branding            key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 13 01 00" base="DM_Set"/>
        <DMS1Event               key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 14 01 00" base="DM_Set"/>
        <DMS1Publication         key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 14 02 00" base="DM_Set"/>
        <DMS1Award               key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 15 01 00" base="DM_Set"/>
        <DMS1CaptionDescription  key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 16 01 00" base="DM_Set"/>
        <DMS1Annotation          key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 17 01 00" base="DM_Set">
            <!-- See annex A12 on page 22 -->
            <DMS1AnnotationSynopsis    type="UTF16String" key="80.2b" globalKey="060e2b34.0101.0105.03020106.09010000"/>
            <DMS1AnnotationDescription type="UTF16String" key="80.2c" globalKey="060e2b34.0101.0105.03020106.0a010000"/>
        </DMS1Annotation>
        <DMS1SettingPeriod       key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 17 02 00" base="DM_Set"/>
        <DMS1Scripting           key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 17 03 00" base="DM_Set"/>
        <DMS1Classification      key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 17 04 00" base="DM_Set"/>
        <DMS1Shot                key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 17 05 00" base="DM_Set"/>
        <DMS1KeyPoint            key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 17 06 00" base="DM_Set"/>
        <DMS1Participant         key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 18 01 00" base="DM_Set">
            <!-- See annex A18 on page 25 -->
            <DMS1ParticipantUID        type="UID"         key="80.39" globalKey="060e2b34.0101.0108.01011540.01010000"/>
            <DMS1JobFunction           type="UTF16String" key="80.34" globalKey="060e2b34.0101.0103.02300501.01000000"/>
            <DMS1PersonSets            type="subVector"   key="80.37" globalKey="060e2b34.0101.0105.06010104.03401400" use="optional" ref="strong" target="DMS1Person">
                <DMS1Person             type="UUID" minLength="16" maxLength="16" globalKey="060e2b34.0101.0105.06010104.03401401"/>
            </DMS1PersonSets>
        </DMS1Participant>
        <DMS1Person              key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 1A 02 00" base="DM_Set"/>
        <DMS1Organisation        key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 1A 03 00" base="DM_Set">
            <!-- See annex A20 on page 26-27 -->
            <DMS1AddressSets           type="subVector"   key="80.4a" globalKey="060e2b34.0101.0105.06010104.05401700" use="optional" ref="strong" target="DMS1Address">
                <DMS1Address            type="UUID" minLength="16" maxLength="16" globalKey="060e2b34.0101.0105.06010104.05401701"/>
            </DMS1AddressSets>
        </DMS1Organisation>
        <DMS1Location            key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 1A 04 00" base="DM_Set"/>
        <DMS1Address             key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 1B 01 00" base="DM_Set">
            <!-- See annex A22 on page 28 -->
            <DMS1CommunicationsSets    type="subVector"   key="80.59" globalKey="060e2b34.0101.0105.06010104.05401800" use="optional" ref="strong" target="DMS1Communications">
                <DMS1Communications     type="UUID" minLength="16" maxLength="16" globalKey="060e2b34.0101.0105.06010104.05401801"/>
            </DMS1CommunicationsSets>
        </DMS1Address>
        <DMS1Communications      key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 1B 02 00" base="DM_Set"/>
        <DMS1Contract            key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 1C 01 00" base="DM_Set"/>
        <DMS1Rights              key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 1C 02 00" base="DM_Set"/>
        <DMS1PictureFormat       key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 1D 01 00" base="DM_Set"/>
        <DMS1DeviceParameters    key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 1E 01 00" base="DM_Set"/>
        <DMS1NameValue           key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 1F 01 00" base="DM_Set"/>
        <DMS1Processing          key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 20 01 00" base="DM_Set"/>
        <DMS1Projects            key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 20 02 00" base="DM_Set"/>
        <DMS1ContactsList        key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 19 01 00" base="DM_Set">
            <!-- See annex A31 on page 32 -->
            <DMS1PersonSets            type="subVector" key="80.3a" globalKey="060e2b34.0101.0105.06010104.05401400" use="optional" ref="strong" target="DMS1Person">
                <DMS1Person             type="UUID" minLength="16" maxLength="16" globalKey="060e2b34.0101.0105.06010104.05401401"/>
            </DMS1PersonSets>
            <DMS1OrganisationSets      type="subVector" key="80.3b" globalKey="060e2b34.0101.0105.06010104.05401500" use="optional" ref="strong" target="DMS1Organisation">
                <DMS1Organisation       type="UUID" minLength="16" maxLength="16" globalKey="060e2b34.0101.0105.06010104.05401501"/>
            </DMS1OrganisationSets>
        </DMS1ContactsList>
        <DMS1CueWords            key="06 0e 2b 34 02 53 01 01 0d 01 04 01 01 17 08 00" base="DM_Set"/>
    </MXFClasses>
</MXFDictionary>

 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

Jump to:  


Who is online

Users browsing this forum: No registered users and 4 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group :: Style based on FI Subice by phpBBservice.nl :: All times are UTC