SourceMobs/MasterMob for ext. wave files

Help
Artur M.
2009-06-09
2015-03-07
  • Artur M.

    Artur M. - 2009-06-09

    Hello everybody,

    I'm started using AAF SDK a month ago to generate an AAF file for my application.
    I have to create SourceMob describing external essence in Wave file. While successfully created WAVEDescriptor with summary, I cannot go thru SourceClip/SourceMob to get working aaf file. I searched thru aaf samples and these forums, but couldn't find hint...
    There are steps of procedure:

    1. OpenNew AAF, get Header, Dictionary, create ClassDefinitions, DataDefinitions; create Composition and Sequence, and insert it to Composition

    2. Create instance of SourceMob
    3. Create instance of FileDescriptor and query it's interface to WAVEDescriptor
    4. Read header of wave file and SetSummary of WAVEDescriptor
    5. Set properties of FileDescriptor - length, sample rate
    6. Query interface to EssenceDescriptor, create Network Locator and append it to EssenceDescriptor.
    7. SetEssenceDescriptor of SourceMob to created essence descriptor.

    Up to here it's working:-) I've problem now:

    8. Create instance of SourceClip ??? (I tried set source reference to (zeroMobID,0,0))
    9. ??? Query interface to segment and AppendNewTimelineSlot to SourceMob
    10. ??? Add SourceMob to Header

    11. Create instance of MasterMob, query int. to Mob
    12. Create new SourceClip, set it source ref to SourceMob (SetSourceReference)
    13. Query int. of this SourceClip to segment and AppendNewTimelineSlot
    14. Add mob to header

    15. Add MasterMob to Composition (thru SourceClip/segment of course:-)

    16. release, release, release... save/close

    I tried many combinations, but always got errors when I tried to read such aaf file. Surely I miss something, but have no idea what:-)

    Cheers
    Artur

     
    • Alexey Kharkevich

      Hi,

      Do you know if your reader (I am assuming you're not developing your own) supports AAF files with external media? If yes, do you have "good" files that your reader can open and that you can use as a template?

      Have you looked at the AAFEssenceAccess unit test (test/com/ComModTestAAF/ModuleTests/CAAFEssenceAccessTest.cpp) executed as part of ComModTestAAF? It creates a WAV media file and an AAF file referencing the WAV and then reads them back. If you already have a WAV and need to only create an AAF this example may not be exactly what you want. But at least it will show you what kind of structures you need to put in your file to make it work with AAF codecs.

      Alexey

       
    • Artur M.

      Artur M. - 2009-06-10

      Hi,
      It will be read by Pro Tools, I created some simple AAF composition with external media just for looking into it. That is strange, because in that aaf (created by PT) file SourceMobs (those with essence descriptor/external locator) referring to another SourceMob, which has empty SourceClip of 24hours length (if it could be helpful I can post InfoDumper output for such simple composition export from Pro Tools).

      At the moment, I was created Source Mob:-) I succesfully tried AddNilReference for file SourceMob and AddMasterSlot for MasterMob, referencing to this source mob. But stopped now - cannot create valid SourceClip for using as segment for composition. Everytime I got errors when trying use SetSourceReference and append to CompMob.

      check(pCDSourceClip->CreateInstance(IID_IAAFSourceClip, (IUnknown **) &compSclp));
      sourceRef.sourceID = masterMobID;
      sourceRef.sourceSlotID = audioSlotID;
      sourceRef.startTime = 0;
      check(compSclp->SetSourceReference (sourceRef));
      check(compSclp->QueryInterface (IID_IAAFComponent, (void **)&aComponent));
      check(aComponent->SetDataDef(pDdefSound));
      check(aComponent->SetLength (240000)); // example only:-)
      check(pSequence->AppendComponent (aComponent));

      When I insert this code, generated AAF is corrupted (8012001d) and has size only about 80kB...

      I will examine this AAFEssenceAccess and will be back anyway:-)
      Thanks for hint.

      Artur

       
  • Darren Winslow

    Darren Winslow - 2013-11-18

    Artur,
    Did you ever figure this out as I too am stuck trying to create an AAF file which references an external (already existing) wav file?

    Thanks,
    Darren

     
    Last edit: Darren Winslow 2013-11-18
  • dbk3r

    dbk3r - 2015-03-07

    same here trying to create an aaf which references existing Video/Audio Files
    , but no success.

    Thanks for any help.

    Denis

     

Log in to post a comment.