P2 filesystem layout

P2 MXF files are OP-Atom, where each track of video and audio are stored in separate files. This complicates the housekeeping of the files since steps must be taken to ensure related tracks are kept together when files are moved or copied. The P2 uses a 6-character identifier in the filename of all related files.

The P2 card lays out all audio tracks under the CONTENTS/AUDIO/ directory and all video tracks under CONTENTS/VIDEO/. In addition, it creates an 80x60 BMP thumbnail in the CONTENTS/ICON/ directory and writes an XML file containing structural metadata describing the clip.

An example layout for DV50 clips (with 4 tracks of audio) is:

LASTCLIP.TXT
CONTENTS/AUDIO/0009E700.MXF
CONTENTS/AUDIO/0009E701.MXF
CONTENTS/AUDIO/0009E702.MXF
CONTENTS/AUDIO/0009E703.MXF
CONTENTS/CLIP/0009E7.XML
CONTENTS/ICON/0009E7.BMP
CONTENTS/VIDEO/0009E7.MXF
For DV25 clips (2 tracks of audio):
LASTCLIP.TXT
CONTENTS/AUDIO/0001F900.MXF
CONTENTS/AUDIO/0001F901.MXF
CONTENTS/CLIP/0001F9.XML
CONTENTS/ICON/0001F9.BMP
CONTENTS/VIDEO/0001F9.MXF
The LASTCLIP.TXT file contains three lines of ASCII text. The first line contains the prefix of the last clip written to the P2 card. The meaning of the other two lines in unknown at this point. E.g.
009E7S
1.0
40

P2 MXF structure

P2 MXF constraints

Initial attempts to transfer independently created MXF files to a P2 camera failed - the P2 camera would not playback the MXF files. Through experiment we found the P2 camera needed the following constraints to be met which may be due to hardware resourse limits in the P2 equipment we tested (model AG-HVX200E). If the constraints were not met, the clip would appear correct in the thumbnail viewer, but would fail to playback.
  • The first sample of essence (video or audio) must be positioned at offset 0x8000
  • The KLV BER encoded lengths must themselves be of the following lengths
    • 8 bytes for the clip-wrapped Essence Element
    • 4 bytes for all other KLV triplets
    The DV-DIF (SMPTE 383M) and AES3/BWAV (SMPTE 382M) generic container mapping documents requires the 8 byte BER long-form encoding for clip wrapped essence. The 4 byte length is a P2 specific constraint.
  • The header must contain an IndexTableSegment. OP-Atom only requires an IndexTableSegment in the footer.
  • When playing back, the timecode displayed is taken from the timecode embedded in the DV frame while the timecode represented by the TimecodeComponent in the MaterialPackage is ignored. The P2 thumbnail viewer will display the start timecode stored in the XML file.
  • The maximum size of the P2 MXF file is 4GB even though P2 cards of higher capacity are available. This is believed to be due to the limitations of the FAT32 filesystem used on the P2 cards. When the 4GB limit is reached the clip must be spanned across multiple clips, in the same way clips must be spanned across multiple P2 cards when a card becomes full.

Observed KLV layout of P2 MXF

The MXF KLV structure depends on whether DV50 or DV25 was recorded. For DV50, there are 6 tracks described in the MaterialPackage: 1 timecode, 4 audio and 1 video. For DV25, there are 4 tracks: 1 timecode, 2 audio and 1 video.

The file offsets of all KLV triplets except the Footer and IndexTable are constant. Additionally, the offsets are the same between DV50 and DV25 files, and is achieved by having more KLVFill in the DV25 file which has fewer tracks.

The following analysis is based on 625/50Hz MXF files only. Output is taken from the MXFDump utility.

For DV50 the structure of an MXF file containing video is:

  K = Header ( 0000000000000000 )
                     DV - 50Mbps 625/50i (clip wrapped)
  K = Primer ( 000000000000007c )
  K = MXFPreface ( 0000000000000572 )
  K = MXFIdentification ( 0000000000000618 )
  K = MXFContentStorage ( 00000000000006b0 )
  K = MXFEssenceContainerData ( 0000000000000720 )
  K = MXFMaterialPackage ( 000000000000077c )
  K = MXFTrack ( 0000000000000870 )
  K = MXFSequence ( 00000000000008d4 )
  K = MXFTimecodeComponent ( 0000000000000938 )
  K = MXFTrack ( 0000000000000997 )
  K = MXFSequence ( 00000000000009fb )
  K = MXFSourceClip ( 0000000000000a5f )
  K = MXFTrack ( 0000000000000adf )
  K = MXFSequence ( 0000000000000b43 )
  K = MXFSourceClip ( 0000000000000ba7 )
  K = MXFTrack ( 0000000000000c27 )
  K = MXFSequence ( 0000000000000c8b )
  K = MXFSourceClip ( 0000000000000cef )
  K = MXFTrack ( 0000000000000d6f )
  K = MXFSequence ( 0000000000000dd3 )
  K = MXFSourceClip ( 0000000000000e37 )
  K = MXFTrack ( 0000000000000eb7 )
  K = MXFSequence ( 0000000000000f1b )
  K = MXFSourceClip ( 0000000000000f7f )
  K = MXFSourcePackage ( 0000000000000fff )
  K = MXFTrack ( 0000000000001093 )
  K = MXFSequence ( 00000000000010f7 )
  K = MXFSourceClip ( 000000000000115b )
  K = MXFCDCIEssenceDescriptor ( 00000000000011db )
  K = IndexTableSegment ( 0000000000001290 )
  K = KLVFill ( 00000000000012f4 )
  K = Body ( 0000000000007f6c )
                     DV - 50Mbps 625/50i (clip wrapped)
  K = Essence Element ( 0000000000007fe8 )
  K = Footer ( [varies] )
                     DV - 50Mbps 625/50i (clip wrapped)
  K = IndexTableSegment ( [varies] )
For DV25 the structure of an MXF file containing video is:
  K = Header ( 0000000000000000 )
                     DV - 25Mbps 625/50i (clip wrapped)
  K = Primer ( 000000000000007c )
  K = MXFPreface ( 0000000000000572 )
  K = MXFIdentification ( 0000000000000618 )
  K = MXFContentStorage ( 00000000000006b0 )
  K = MXFEssenceContainerData ( 0000000000000720 )
  K = MXFMaterialPackage ( 000000000000077c )
  K = MXFTrack ( 0000000000000850 )
  K = MXFSequence ( 00000000000008b4 )
  K = MXFTimecodeComponent ( 0000000000000918 )
  K = MXFTrack ( 0000000000000977 )
  K = MXFSequence ( 00000000000009db )
  K = MXFSourceClip ( 0000000000000a3f )
  K = MXFTrack ( 0000000000000abf )
  K = MXFSequence ( 0000000000000b23 )
  K = MXFSourceClip ( 0000000000000b87 )
  K = MXFTrack ( 0000000000000c07 )
  K = MXFSequence ( 0000000000000c6b )
  K = MXFSourceClip ( 0000000000000ccf )
  K = MXFSourcePackage ( 0000000000000d4f )
  K = MXFTrack ( 0000000000000de3 )
  K = MXFSequence ( 0000000000000e47 )
  K = MXFSourceClip ( 0000000000000eab )
  K = MXFCDCIEssenceDescriptor ( 0000000000000f2b )
  K = IndexTableSegment ( 0000000000000fe0 )
  K = KLVFill ( 0000000000001044 )
  K = Body ( 0000000000007f6c )
                     DV - 25Mbps 625/50i (clip wrapped)
  K = Essence Element ( 0000000000007fe8 )
  K = Footer ( [varies] )
                     DV - 25Mbps 625/50i (clip wrapped)
  K = IndexTableSegment ( [varies] )
For DV50 audio MXF files the structure is:
 K = Header ( 0000000000000000 )
                    AES3/BWF - AES3 (clip wrapped)
 K = Primer ( 000000000000007c )
 K = MXFPreface ( 0000000000000572 )
 K = MXFIdentification ( 0000000000000618 )
 K = MXFContentStorage ( 00000000000006b0 )
 K = MXFEssenceContainerData ( 0000000000000720 )
 K = MXFMaterialPackage ( 000000000000077c )
 K = MXFTrack ( 0000000000000870 )
 K = MXFSequence ( 00000000000008d4 )
 K = MXFTimecodeComponent ( 0000000000000938 )
 K = MXFTrack ( 0000000000000997 )
 K = MXFSequence ( 00000000000009fb )
 K = MXFSourceClip ( 0000000000000a5f )
 K = MXFTrack ( 0000000000000adf )
 K = MXFSequence ( 0000000000000b43 )
 K = MXFSourceClip ( 0000000000000ba7 )
 K = MXFTrack ( 0000000000000c27 )
 K = MXFSequence ( 0000000000000c8b )
 K = MXFSourceClip ( 0000000000000cef )
 K = MXFTrack ( 0000000000000d6f )
 K = MXFSequence ( 0000000000000dd3 )
 K = MXFSourceClip ( 0000000000000e37 )
 K = MXFTrack ( 0000000000000eb7 )
 K = MXFSequence ( 0000000000000f1b )
 K = MXFSourceClip ( 0000000000000f7f )
 K = MXFSourcePackage ( 0000000000000fff )
 K = MXFTrack ( 0000000000001093 )
 K = MXFSequence ( 00000000000010f7 )
 K = MXFSourceClip ( 000000000000115b )
 K = MXFAES3AudioEssenceDescriptor ( 00000000000011db )
 K = IndexTableSegment ( 0000000000001272 )
 K = KLVFill ( 00000000000012d6 )
 K = Body ( 0000000000007f6c )
                    AES3/BWF - AES3 (clip wrapped)
 K = Essence Element ( 0000000000007fe8 )
 K = Footer ( [varies] )
                    AES3/BWF - AES3 (clip wrapped)
 K = IndexTableSegment ( [varies] )
For DV25 audio MXF files the structure is:
 K = Header ( 0000000000000000 )
                    AES3/BWF - AES3 (clip wrapped)
 K = Primer ( 000000000000007c )
 K = MXFPreface ( 0000000000000572 )
 K = MXFIdentification ( 0000000000000618 )
 K = MXFContentStorage ( 00000000000006b0 )
 K = MXFEssenceContainerData ( 0000000000000720 )
 K = MXFMaterialPackage ( 000000000000077c )
 K = MXFTrack ( 0000000000000850 )
 K = MXFSequence ( 00000000000008b4 )
 K = MXFTimecodeComponent ( 0000000000000918 )
 K = MXFTrack ( 0000000000000977 )
 K = MXFSequence ( 00000000000009db )
 K = MXFSourceClip ( 0000000000000a3f )
 K = MXFTrack ( 0000000000000abf )
 K = MXFSequence ( 0000000000000b23 )
 K = MXFSourceClip ( 0000000000000b87 )
 K = MXFTrack ( 0000000000000c07 )
 K = MXFSequence ( 0000000000000c6b )
 K = MXFSourceClip ( 0000000000000ccf )
 K = MXFSourcePackage ( 0000000000000d4f )
 K = MXFTrack ( 0000000000000de3 )
 K = MXFSequence ( 0000000000000e47 )
 K = MXFSourceClip ( 0000000000000eab )
 K = MXFAES3AudioEssenceDescriptor ( 0000000000000f2b )
 K = IndexTableSegment ( 0000000000000fc2 )
 K = KLVFill ( 0000000000001026 )
 K = Body ( 0000000000007f6c )
                    AES3/BWF - AES3 (clip wrapped)
 K = Essence Element ( 0000000000007fe8 )
 K = Footer ( [varies] )
                    AES3/BWF - AES3 (clip wrapped)
 K = IndexTableSegment ( [varies] )

Get Ingex - video capture and transcoding at SourceForge.net. Fast, secure and Free Open Source software downloads Valid HTML 4.01!