pyaaf2 icon indicating copy to clipboard operation
pyaaf2 copied to clipboard

Destructive (in-place) change of MXF files

Open BoukeVahl opened this issue 1 year ago • 3 comments

Hi,

Trying to do a destructive change of MXF files, just metadata. Parsing the MXF works fine, but since pyaaf2 does not do changing, I need to do so myself. Not a big deal to open the files and change a few bytes, but where?

I've managed to change the mxf.py module, mainly iter_tags, I've added f.tell() in the yield line, and added items to the classes for the items I want to change. But, this is of course not a future proof way.

So my question, is there a way to find the exact position in files where specific (meta)data is stored? Or can I ask for this as a feature request? Or, even better, would it be possible if the module itself would allow for in-place changing? (When possible, I can imagine swapping out an array for a larger one will be impossible.)

Thx, Bouke

BoukeVahl avatar Jul 10 '22 10:07 BoukeVahl

Destructive editing of MXF files is kind of out of the scope of this project. The MXF parser could be modified to include the file offsets on the MXFObject class, would definitely be useful when debugging. Have you look at the MXFDump utility? It gives you this kind of info too.

markreidvfx avatar Jul 10 '22 23:07 markreidvfx

Hi Mark, Ah, blast from the past. (the MXFdump, have not looked at that for a long time...) What would it take to include the offsets? (Name your price, either in money or other things, and the direction it should flow.) I am totally willing to help, but I'm afraid (pretty darn sure) I'm not worthy to work on your code.

BoukeVahl avatar Jul 11 '22 00:07 BoukeVahl

Oh, if you take this, please make the dump in something like a true dict or JSON, or something else simpler to parse.

BoukeVahl avatar Jul 11 '22 00:07 BoukeVahl