Menu

How To : Comments in AAF File ???

Help
2008-07-28
2015-08-17
  • Pascal GOSSET

    Pascal GOSSET - 2008-07-28

    Hi,

    I would like some help to How create comments for reading this file by Avid System ?

    I have created an composition with Video tracks and audio tracks and an EventMobSlot track for write comments but Avid don't read my comments ... (Others informations are Ok in Avid).

    There is some reference to add ?

    Can you help me ?

    thanks and sorry for my bad English,

    Pascal GOSSET

     
    • Alexey Kharkevich

      Are you talking about the value of the 'Comments' bin column? Or is it the comments in locators?

      Alexey

       
    • Pascal GOSSET

      Pascal GOSSET - 2008-07-31

      Comments in Locators (AVID)

      Pascal

       
      • Alexey Kharkevich

        I have an example application that creates Descriptive Markers in an existing AAF file. Eventually I'd like to make it a part of the SDK. For now, here's an excerpt from the example, a function that adds a Descriptive Marker to a Sequence in an Event Mob Slot.

        Alexey

        // Create an instance of DescriptiveMarker at the specified position
        // and targeting the specified slot, and add it to the specified
        // sequence.
        AAFRESULT addDescriptiveMarker(
            IAAFFile* file,
            IAAFSequence* sequence,         // sequence to add the new DescriptiveMarker to
            aafPosition_t position,         // starting time of the new DescriptiveMarker
            const aafCharacter* comment,  // Comment on the new DescriptiveMarker
            aafUInt32 describedSlotID )     // slot described by the new DescriptiveMarker
        {
            assert( file != 0 );
            assert( sequence != 0 );

            AAFRESULT  hr = AAFRESULT_SUCCESS;

            try
            {
                // Remember the data definition of the sequence
                IAAFComponentSP sequenceComponent;
                checkResult( sequence->QueryInterface( IID_IAAFComponent,
                                                       (void**)&sequenceComponent ) );
                IAAFDataDefSP  dataDef;
                checkResult( sequenceComponent->GetDataDef( &dataDef ) );

                // Dictionary
                IAAFDictionarySP  dictionary;
                checkResult( file->GetDictionary( &dictionary ) );

                // Get the class definition and use it to create an
                // instance of AAFDescriptiveMarker.
                IAAFClassDefSP  classDef;
                checkResult( dictionary->LookupClassDef( AUID_AAFDescriptiveMarker,
                                                         &classDef ) );
                IAAFDescriptiveMarkerSP dm;
                checkResult( classDef->CreateInstance( IID_IAAFDescriptiveMarker,
                                                       (IUnknown**)&dm ) );

                // Obtain other interfaces implemented by AAFDescriptiveMarker
                IAAFEventSP dmEvent;
                checkResult( dm->QueryInterface( IID_IAAFEvent,
                                                 (void**)&dmEvent ) );
                IAAFComponentSP dmComponent;
                checkResult( dm->QueryInterface( IID_IAAFComponent,
                                                 (void**)&dmComponent ) );

                // Initialize the new AAFDescriptiveMarker object
                checkResult( dm->Initialize() );
                checkResult( dm->SetDescribedSlotIDs( 1, &describedSlotID ) );
                checkResult( dmEvent->SetPosition( position ) );
                checkResult( dmEvent->SetComment( comment ) );
                checkResult( dmComponent->SetDataDef( dataDef ) );

                // Add the new AAFDescriptiveMarker to the Sequence
                checkResult( sequence->AppendComponent( dmComponent ) );
            }
            catch( HRESULT e )
            {
                hr = e;
            }
            catch(...)
            {
                hr = AAFRESULT_UNEXPECTED_EXCEPTION;
            }

            return hr;
        }

         
        • Bill Baker

          Bill Baker - 2015-08-17

          I appreciate this is a while ago now, but are you able to share any examples of how to create a sequence in an EventMobSlot? I have tried various routes, and although it seems to attach, when saving the file I get an AAFRESULT_ASSERTION_VIOLATION returned and end up with a corrupted file (("Non-void strong reference", pointer != 0) in OMObjectReference.cpp). I can successfully attach CommentMarkers to a Segment and attach to an EventMobSlot, but I would like to attach my CommentMarkers to a Sequence to emulate the behaviour of MediaComposer in exporting CompositionMob with CommentMarkers.

          Any help would be greatly appreciated!

           

Log in to post a comment.