MXF new tag support

Started by javiavid, March 25, 2021, 11:16:36 AM

Previous topic - Next topic

javiavid

Hello,
I'm trying to use MXF in Photools iMatch, I've been talking to its developer but he told me that it's not possible to read these essential tags to catalog the MXF.

I manage to read these tags with the -a -u -G1 option, but they are not manageable by iMatch.
The developer encouraged me to ask you.

I am not an expert in MXF and although there are more types, as an editor I usually handle 2 types: OP1a and OP-Atom.

OP1a
It has the sound channels inside the MXF along with the video.
OP1a is the format used by Sony for XD-CAMs.

OP-Atom
The sound channels are in separate files.
OP-Atom is commonly used by Avid, Panasonic with the P2 format.

Both types of MXF can contain multiple codecs inside, ProRes, DNxHD, DVCPro, AVC-Intra...

The tags I am requesting are as follows:

---Video Coding Scheme ID
In order to read this tag you must use the -a -u -G1 option.
This tag name is unique, but the group is not always the same, it can be in [Track 1][Track 4][Track 5][MXF]....
It contains a number that corresponds to the codec of the video (the last 11 digits).

Here are some examples, each line is equivalent to a different video file:

MXF OP1a files
Track4] Video Coding Scheme ID : 060e2b34-0401-010d-0401-020203060300    (ProRes 422)
Track4] Video Coding Scheme ID : 060e2b34-0401-010d-0401-020203060400    (ProRes 422 HQ)
Track4] Video Coding Scheme ID : 060e2b34-0401-010d-0401-020203060500
Track1] Video Coding Scheme ID : 060e2b34-0401-010a-0401-020271080000
Track1] Video Coding Scheme ID : 060e2b34-0401-010a-0401-020271090000
Track5] Video Coding Scheme ID : 060e2b34-0401-0103-0401-020201040300

MXF OP-Atom files
MXF] Video Coding Scheme ID : 060e2b34-0401-010a-0401-020201323102   
MXF] Video Coding Scheme ID : 060e2b34-0401-010a-0401-020271080000

---Duration
The duration is not correct in the OP-Atom.

MXF OP1a files
Correct duration

Example:
Duration :1.20 s

OP-Atom
Incorrect duration

Examples:
5 days 0:00:00

If we use the -a -u -G1 -Track1:Duration tag, more tags named Duration appear and some of them contain the correct duration.

Example:
[Track1] Duration : 5 days 0:00:00
[Track1] Duration : 1.20 s
[Track1] Duration : 1.20 s

Here the solution is more complicated than in the previous tag because it doesn't always show 3 Duration, there can be 2,3,4,5..., but what is sure is that they are in the [Track1] and the last one in the list is always correct (tested in 50 files). This is also true for OP1a files, so it wouldn't be necessary to make 2 versions, just always use the last line Track1:Duration (tested on 10 different OP1a codecs).

If you need it I can send you test files.


Phil Harvey

You can send the test files to philharvey66 at gmail.com

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

javiavid

You already have the test videos available in your email.

Phil Harvey

I got the samples, thanks.

I'll remove the Unknown status of VideoCodingSchemeID as you requested.

But I don't understand the Duration situation.  ExifTool gets the priority duration from the TimecodeComponent in the file.  For example, here is what we see in the -v3 output for the Atom/13-AVCintra-atom.mxf file you sent:

  TimecodeComponent (SubDirectory) -->
  - Tag '060e2b34.0253.0101.0d010101.01011400' (75 bytes):
     1f5d3: 3c 0a 00 10 b4 77 cd fb 32 2e 49 c2 aa b1 a9 4b [<....w..2.I....K]
     1f5e3: b3 6a d3 9a 15 03 00 01 00 15 02 00 02 00 19 15 [.j..............]
     1f5f3: 01 00 08 00 00 00 00 00 16 77 49 02 02 00 08 00 [.........wI.....]
     1f603: 00 00 00 00 a4 cb 80 02 01 00 10 06 0e 2b 34 04 [.............+4.]
     1f613: 01 01 01 01 03 02 01 01 00 00 00                [...........]
  + [MXF LocalSet directory, 75 bytes]
  | InstanceUID = b477cdfb-322e-49c2-aab1-a94bb36ad39a
  | - Tag '060e2b34.0101.0101.01011502.00000000', Local 0x3c0a (16 bytes):
  |    1f5d7: b4 77 cd fb 32 2e 49 c2 aa b1 a9 4b b3 6a d3 9a [.w..2.I....K.j..]
  | DropFrame = False
  | - Tag '060e2b34.0101.0101.04040101.05000000', Local 0x1503 (1 bytes):
  |    1f5eb: 00                                              [.]
  | RoundedTimecodeTimebase = 25
  | - Tag '060e2b34.0101.0102.04040101.02060000', Local 0x1502 (2 bytes, int16u[1]):
  |    1f5f0: 00 19                                           [..]
  | StartTimecode = 1472329
  | - Tag '060e2b34.0101.0102.07020103.01050000', Local 0x1501 (8 bytes, int64s[1]):
  |    1f5f6: 00 00 00 00 00 16 77 49                         [......wI]
  | Duration = 10800000
  | - Tag '060e2b34.0101.0102.07020201.01030000', Local 0x0202 (8 bytes):
  |    1f602: 00 00 00 00 00 a4 cb 80                         [........]
  | ComponentDataDefinition = 060e2b34.0401.0101.01030201.01000000
  | - Tag '060e2b34.0101.0102.04070100.00000000', Local 0x0201 (16 bytes):
  |    1f60e: 06 0e 2b 34 04 01 01 01 01 03 02 01 01 00 00 00 [..+4............]


The Duration of 10800000 translates to 432000 seconds since the EditRate is 25/s.

If you have any ideas about this, I'll take any help you can give.  Otherwise I will have to do a deep dive into the MXF specification and try to figure out a better way to determine Duration, which may take some time.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

javiavid

Using the -V3 option I have found 2 lines that contain the text:
Duration = 76.

This would be 3.04s that is the correct duration.
I do not know if this could help you.

Phil Harvey

Unfortunately that doesn't help.  This is harder than it should be.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

javiavid

I don't know if I can help you.., I'm new to metadata. What exactly would you need?

Phil Harvey

I really need someone who understands the MXF specification. :(

I think I will just need to do the work myself and spend time studying the spec.  I've already spent a few hours on this today (and as a result the anticipated ExifTool release will have to wait until next week), and I'm no further ahead.  So I'l have to put this on a back burner for now and get on with other features I want in this release.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

javiavid

No hurry with this, thank you very much for your time.

javiavid

There is a tool called Mediainfo that works very well with MXF, it is open source and free.
It also has command line version and detects correctly the duration of the files.

Their website is this:
https://mediaarea.net/en/MediaInfo

And the help forum is here
https://sourceforge.net/p/mediainfo/discussion/

Maybe they can help you.

I attach a screenshot with the information extracted with one of the files I sent you.
To generate the information use the command:
mediainfo 13-AVCintra-atom.mxf

The problem is in the OP-Atom files, if you need more OP-Atom files, I have files with 73 types of codecs.


javiavid

Hi Phil,
I have checked that you have added the Video Coding tag in the new version of iMatch. Thank you very much!

I guess you've been busy with the new version, do you think there's any chance of getting the correct duration tag in the future?

Phil Harvey

It will take some work, but I'll look into it when I get a chance.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).