freeMXF.org

Open discussion about freeMXF.org tools and MXF in general
It is currently Sat Apr 04, 2020 3:57 pm
Board index » MXF Categories » freeMXF.org Tools



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

Offline
Board User

Joined: Mon Oct 22, 2007 1:43 pm
Posts: 9

Post Posted: Fri Apr 18, 2008 12:25 pm 
Top  
I've been trying to create a Partial Restore application for XDCAM pal d10 imx 50 mxf files.
As a first step I'm trying to duplicate an example XDCAM file.

The Essence in our XDCAM file is framewrapped.
I've written a custom EssenceSource (RAW_essenceSource) that has a Smartpointer to the Partition that contains the essence in the original file, and also an UL defining the essence stream we wish to extract from this Partition.

When the RAW_essenceSource::BaseGetEssenceData() function is called, it returns the Data(Chunk) of the next retrieved KLVObjectPtr (Partition->NextElement()) that matches with the chosen UL

Thus, I'm able to create an unindexed file.

Code:
...

EssenceSourcePtr Source = new RAW_EssenceSource(ThisPartition,elementUL,UInt8(0x05),UInt8(0x01));
EssenceSourcePtr Source2 = new RAW_EssenceSource(ThisPartition,elementUL_2,UInt8(0x06),UInt8(0x01));

BodyStreamPtr Stream = new BodyStream(BodySID,Source);
Stream->AddSubStream(Source2);

Stream->SetWrapType(BodyStream::StreamWrapFrame);

BodyWriterPtr Writer = new BodyWriter(OutFile);

Writer->SetKAG(512);
Writer->SetForceBER4(true);
Writer->SetMetadataSharing(true, true);
Writer->AddStream(Stream);
            

PartitionPtr NewPart = new Partition(OpenHeader_UL);

...

NewPart->AddMetadata(HMeta);
               
Writer->SetPartition(NewPart);
Writer->WriteHeader(true,true);
Writer->WriteBody();
Writer->WriteFooter(false);

OutFile->Close();




The original XDCAM file however contains an index of the type (or so I think):

Code:
Stream->SetIndexType( (BodyStream::IndexType) ( BodyStream::StreamIndexCBRHeader
                                                         | BodyStream::StreamIndexCBRBody
                                                         | BodyStream::StreamIndexCBRFooter) );


I've tried indexing the file but my console output always returns an infinite number of error messages:

Quote:
ERROR: Attempted to index a stream with no index manager


I've created an IndexManager but I don't know how and cannot find an example on how to link it to the BodyWriter.

Code:
IndexManagerPtr IndexMan = new IndexManager(0,Source->GetEssenceDataSize());
IndexMan->SetBodySID(BodySID);
IndexMan->SetIndexSID(1);
IndexMan->SetEditRate(Source->GetEditRate());
IndexMan->SetValueRelativeIndexing(false);


How does one ceate and add a valid IndexManager, that works with a custom EssenceSource? And how does one link this IndexManager to the considered EssenceSources/BodyStream/BodyWriter ?

 Profile  

Offline
Board User

Joined: Mon Oct 22, 2007 1:43 pm
Posts: 9

Post Posted: Fri Apr 18, 2008 1:33 pm 
Top  
I should write more forum posts.
Half an hour after posting I find half of the answer:

First, it's

Code:
Stream->SetIndexType( (BodyStream::IndexType) ( BodyStream::StreamIndexCBRHeader
                                                         | BodyStream::StreamIndexCBRBody) );


It seems that apart from a few more obvious steps
Stream->SetIndexSID(1);
is nescessary.

 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 1 guest

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