freeMXF.org

Open discussion about freeMXF.org tools and MXF in general
It is currently Thu Mar 28, 2024 3:18 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: Mon Dec 17, 2007 8:46 am 
Top  
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:
Code:
if (!mxfFile->Open(filepath, true))
{
  perror(filepath);
  error("Unable to open file\n");
  exit(1);
}

mxfFile->GetRIP();
   
res = Alter_Item(mxfFile, NewValue);
   
mxfFile->Close();

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

if(mSoundDesc)
{
  mSoundChannelCount = mSoundDesc->Child(ChannelCount_UL);
  if(mSoundChannelCount)
  {
    mSoundChannelCount->SetUInt(ChannelCount);
    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?

edit:

I tried to use
Code:
mxfFile->ReWritePartition(MasterPartition);

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

 Profile  

Offline
Insider

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

Post Posted: Tue Dec 18, 2007 12:08 pm 
Top  
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 64 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