Menu

Time code of first frame in OP1A files

2017-04-20
2017-04-20
  • Sergey Romashev

    Sergey Romashev - 2017-04-20

    Hi.

    I try to get some metadata from OP1A MXF files including time code of first frame.
    I use bmx::MXFFileReader GetMaterialTimecode(), GetSourceTimecode().
    It works fine, but some files reports 00:00:00.00 timecode.
    However MediaInfo reports 00:00:00:01 in video stream.
    It is critical for me.

    Maybe it is wrong way?
    Prompt please where to go.

    Thanks.

     
  • Philip de Nier

    Philip de Nier - 2017-04-20

    A MXF file can have several timecodes in different places, e.g. in the MXF header metadata and in the video essence. The GetMaterialTimecode() method returns the timecode in the MXF header metadata's Material Package. If there is no timecode then GetMaterialTimecode() returns a 00:00:00:00 timecode. Use HaveMaterialTimecode() to check that the timecode exists in the file.

    You can see what that value should be by using MXFlibs mxfdump for example; look for the Timecode Component in the Material Package.

    I don't know where MediaInfo is extracting the timecode. It might be finding a timecode in the video essence which bmx is not reading.

    Philip

     
  • Sergey Romashev

    Sergey Romashev - 2017-04-21

    Thanks Philip for quick answer.

    Maybe not bmx, but mxf or mxfpp will help me?

    I try to get timecodes:

    // time codes
    if (fr->HaveMaterialTimecode())
    test_info->material_time_code = fr->GetMaterialTimecode();

    if (fr->HaveFileSourceTimecode())
    test_info->file_source_time_code = fr->GetFileSourceTimecode();

    if (fr->HavePhysicalSourceTimecode())
    test_info->physical_source_time_code = fr->GetPhysicalSourceTimecode();

    if (fr->HavePlayoutTimecode())
    test_info->playout_time_code = fr->GetPlayoutTimecode();

    if (fr->HaveSourceTimecode())
    test_info->source_time_code = fr->GetSourceTimecode();

    But they all reports 00:00:00:00.

    I tried MXFDump.exe and mxf2raw.exe. Unfortunately they skip over (timecode component is located on file offset 0x0002B46A).

    /*MXFDump*/
    [ K = Essence Element ( 000000000002b400 )
    06.0e.2b.34.01.02.01.01.0d.01.03.01.18.01.01.00, L =     144000 (23280), LL = 4 ]
      Track          = 18.01.01.00
      Item Type      = "GC Compound" (18)
      Element Type   = "DV-DIF (Frame Wrapped)" (01)
      Element Count  = 1 (01)
      Element Number = 0 (00)
    [ Value truncated from     144000 bytes to          0 bytes ]
    
    [ K = LegacyKLVFill ( 000000000004e694 )
    06.0e.2b.34.01.01.01.01.03.01.02.10.01.00.00.00, L =        344 (158), LL = 4 ]
    ...
    
    /*mxf2raw*/
    Clip
      edit_rate       : 25/1
      duration        : 00:00:14:00 (count='350')
      StartTimecodes:
        material        : 00:00:00:00
        file_source     : 00:00:00:00
      Tracks: (6)
        Track #0:
          essence_kind    : Picture
          essence_type    : IEC_DV_25
          ec_label        : urn:smpte:ul:060e2b34.04010101.0d010301.02020201
          edit_rate       : 25/1
          duration        : 00:00:14:00 (count='350')
          Packages: (1)
            Package #0:
              Material:
                package_uid     : urn:smpte:umid:060a2b34.01010105.01010d23.13000000.595bc38c.d97f483a.8e6ebcee.c1720d3f
                track_id        : 2
                track_number    : 0
              FileSource:
                package_uid     : urn:smpte:umid:060a2b34.01010105.01010d23.13000000.2e11b50d.ce4c4d37.8e10e42d.9b16956e
                track_id        : 2
                track_number    : 0x18010100
                file_uri        : file:///d:/share/00/SD_00.00.00.01%28Customer%29.MXF
          PictureDescriptor:
            coding_label    : urn:smpte:ul:060e2b34.04010101.04010202.02010200
            signal_standard : ITU_601 (value='1')
            frame_layout    : Separate_Fields (value='1')
            stored_width    : 720
            stored_height   : 576
            display_width   : 720
            display_height  : 576
            display_x_offset : 0
            display_y_offset : 0
            aspect_ratio    : 16/9
            CDCIDescriptor:
              component_depth : 8
              horiz_subsamp   : 2
              vert_subsamp    : 2
              color_siting    : Rec_601 (value='4')
        Track #1:
          essence_kind    : Sound
    

    ...

    I try MediaInfo details mode and get information:

    0002B400 DV (144020 bytes)
    0002B400  Header (20 bytes)
    0002B400   Code (16 bytes)
    0002B400    Start (0x06):                        6 (0x06)
    0002B401    Length of the remaining key (0x0E):  14 (0x0E)
    0002B402    ISO, ORG (0x2B):                     43 (0x2B)
    0002B403    SMPTE (0x34):                        52 (0x34)
    0002B404    Category:                            1 (0x01) - Item
    0002B405    Registry:                            2 (0x02) - Essence
    0002B406    Structure:                           1 (0x01) - Standard
    0002B407    Version:                             1 (0x01) - Essence element
    0002B408    Item Designator:                     13 (0x0D) - User Organisation Registered For Public Use
    0002B409    Organization:                        1 (0x01) - AAF
    0002B40A    Application:                         3 (0x03) - MXF Generic Container Keys
    0002B40B    Structure Version:                   1 (0x01) - Version 1
    0002B40C    Item Type Identifier:                24 (0x18) - GC Compound
    0002B40D    Essence Element Count:               1 (0x01)
    0002B40E    Essence Element Type:                1 (0x01)
    0002B40F    Essence Element Number:              0 (0x00)
    0002B410   Length:                               131 (0x83)
    0002B411   Length:                               144000 (0x023280)
    0002B414  Header - 0 (80 bytes)
    0002B414   Header (3 bytes)
    0002B419    SCT - Section Type:                  0 (0x00) - (3 bits) - Header
    0002B418    Res - Reserved:                      Yes
    0002B414    Arb - Arbitrary bits:                15 (0x0F) - (4 bits)
    0002B418    Dseq - DIF sequence number:          0 (0x00) - (4 bits)
    0002B417    FSC - Channel number:                No
    0002B416    FSP - Channel number:                Yes
    0002B414    Res - Reserved:                      3 (0x03) - (2 bits)
    0002B416    DBN - DIF block number:              0 (0x00)
    0002B41E   DSF - DIF Sequence Flag:              Yes
    0002B41D   Zero:                                 No
    0002B417   Reserved:                             63 (0x3F) - (6 bits)
    0002B41A   Reserved:                             31 (0x1F) - (5 bits)
    0002B417   APT:                                  0 (0x00) - (3 bits)
    0002B41E   TF1 - Audio data is not valid:        No
    0002B41A   Reserved:                             15 (0x0F) - (4 bits)
    0002B417   AP1 - Audio application ID:           0 (0x00) - (3 bits)
    0002B41E   TF2 - Video data is not valid:        No
    0002B41A   Reserved:                             15 (0x0F) - (4 bits)
    0002B417   AP2 - Video application ID:           0 (0x00) - (3 bits)
    0002B41E   TF3 - Subcode is not valid:           No
    0002B41A   Reserved:                             15 (0x0F) - (4 bits)
    0002B417   AP3 - Subcode application ID:         0 (0x00) - (3 bits)
    0002B41C   Reserved:                             (72 bytes)
    0002B464  Subcode - 0 (80 bytes)
    0002B464   Header (3 bytes)
    0002B469    SCT - Section Type:                  1 (0x01) - (3 bits) - Subcode
    0002B468    Res - Reserved:                      Yes
    0002B464    Arb - Arbitrary bits:                15 (0x0F) - (4 bits)
    0002B468    Dseq - DIF sequence number:          0 (0x00) - (4 bits)
    0002B467    FSC - Channel number:                No
    0002B466    FSP - Channel number:                Yes
    0002B464    Res - Reserved:                      3 (0x03) - (2 bits)
    0002B466    DBN - DIF block number:              0 (0x00)
    0002B467   ssyb (8 bytes)
    0002B46E    FR - Identification of half of channel: Yes
    0002B46B    AP3 - Subcode application ID:        0 (0x00) - (3 bits)
    0002B46B    Arb - Arbitrary bits:                255 (0xFF) - (8 bits)
    0002B467    Syb - SSYSB number:                  0 (0x00) - (4 bits)
    0002B469    0xFF:                                255 (0xFF)
    0002B46A    timecode - 00:00:00.040 (5 bytes)
    0002B46A     Pack Type:                          19 (0x13)
    0002B472     CF - Color fame:                    No
    0002B471     Arbitrary bit:                      No
    0002B46F     Frames (Tens):                      0 (0x00) - (2 bits)
    0002B46B     Frames (Units):                     1 (0x01) - (4 bits)
    0002B472     BGF0 - Binary group flag:           No
    0002B46F     Seconds (Tens):                     0 (0x00) - (3 bits)
    0002B46B     Seconds (Units):                    0 (0x00) - (4 bits)
    0002B472     BGF2 - Binary group flag:           No
    0002B46F     Minutes (Tens):                     0 (0x00) - (3 bits)
    0002B46B     Minutes (Units):                    0 (0x00) - (4 bits)
    0002B472     PC - Biphase mark polarity correction: No
    0002B471     BGF2 - Binary group flag:           No
    0002B46F     Hours (Tens):                       0 (0x00) - (2 bits)
    0002B46B     Hours (Units):                      0 (0x00) - (4 bits)
    

    ....

    I see the timecode component on 0002B46A offset.
    I got the same offset while debuging MediaInfo with MS Visual Studio.

    I can not use MediaInfo because this is very very slow.
    I will be glad to any information on this topic.

    Thanks in advance.

     
  • Philip de Nier

    Philip de Nier - 2017-04-26

    bmx (and libMXF) only reads timecode from the MXF wrapper. The timecode you are referring to is in the DV essence, which bmx does not read. The bmxparse utility shows the information that is extracted from raw essence when wrapping using raw2bmx.

    Generally I would expect MXF readers to use the timecode in the MXF wrapper, e.g. the Material Package timecode, and ignore any timecode that might be in the essence. MediaInfo should be showing the MXF timecode. See EBU MXF Timecode Implementation for a description of timecode in MXF.

    Philip

     
  • Sergey Romashev

    Sergey Romashev - 2017-04-27

    Much thanks, Philip.

     
MongoDB Logo MongoDB