Open discussion about tools and MXF in general
It is currently Wed Dec 02, 2020 3:27 pm
Board index » MXF Categories » Tools

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

Board User

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

Post Posted: Mon Dec 17, 2007 8:46 am 
To run a series of tests I am required to be able to alter the value of a single metadata item. I’ve found little to no documentation on this.
The way I thought it would work was by opening the file, altering the value and closing it, as I didn’t find an mxfFile->Save() function:
if (!mxfFile->Open(filepath, true))
  error("Unable to open file\n");

res = Alter_Item(mxfFile, NewValue);

Where the alteration looks like (in the case of a channelcount sounddescriptor item):

  mSoundChannelCount = mSoundDesc->Child(ChannelCount_UL);
    printf("Just altered count: %u\n", mSoundChannelCount->GetUInt());

The print to stdout displays the correct value, but as soon as the mxfFile()->Close() statement is called the item is returned to it’s old value.

What is the standard way to do such a thing?


I tried to use

before closing the file.
But then I get an error
 ERROR: Not enough space to re-write updated header at position 0x00040020 in AFile.mxf



Joined: Thu Apr 15, 2004 10:39 am
Posts: 198
Location: Scotland

Post Posted: Tue Dec 18, 2007 12:08 pm 
The problem is that in order to write a modified copy of the header metadata the 377M specification states that you must add an Identification Set describing the device that makes this modification (and link via GenerationUID).

This makes the revised header metadata bigger. If the header metadata in the file is followed by a filler then the ReWritePartition() function reduces this filler so that the revised metadata fits. If this is not possible then you are stuck.

The only other option is to turn the header into an open header and rewrite the footer as an updated version.

 Profile WWW  
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
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group :: Style based on FI Subice by :: All times are UTC