EN ES FR

Unsupported Browser

This page probably won't work great in Internet Explorer. We generally only support the recent versions of major browsers like Chrome, Firefox, Safari and Edge.

What is MXF?

MXF stands for Media Exchange Format.
This is a standard defined by SMPTE used by the production and broadcasting industry.

M edia e X change F ormat

MXF is not a video or audio format, but a container format:

  • MXF organizes the media content inside the file in several tracks.
  • Each track can be encoded in a different video or audio format

MXF has been around for many years.
Back in 2005, it was already used by Panasonic cameras using P2 storage, to record in DVCPRO format.

In the last decade, the success of XDCAM HD422 camcorders like Sony PWM-200 and of Canon XF products like Cinema EOS C300 has given MXF a prominent place in professional workflows.

More recently, the H.264/AVC based video formats XAVC, used by Sony, Panasonic AVC Ultra and Canon XF-AVC, have embraced the MXF container during transition to 4K.

In the present, high-end workflows also use MXF, both at production and post stages: ARRIRAW, Sony X-OCN and Canon XF-HEVC.

Corrupted MXF

Most common situations where MXF files need to be repaired are:

  • Compact Flash card became corrupt and MXF files were recovered using disk recovery software
  • A full SD card was put in camera instead of a blank one, footage was overwritten with new content before operator could dump the data off of it
  • Everything transferred correctly but movie was corrupted on computer hard drive.
  • Failed recording leaving a .RSV or a .TMP file instead of lost .MXF
  • Last clip on Canon CF card is unplayable. Rest of clips are OK
  • CFast card formatted in camera or deleted accidentally
  • XQD Card failed to copy data across on computer
Audio Track #4 Video Track Audio Track #1 Audio Track #2 Audio Track #3 Track #3

The corrupted MXF file still contains some video and audio data, but the nice structure that existed is now gone.
Repairing the MXF file consists on salvaging all existing media inside the file and put it into a new MXF container.

Scanning the corrupted MXF with Treasured

With Treasured, our free diagnostics tool, you can see through the corrupted file and figure out what it contains.

  • Video format: Sony XAVC Intra
  • Dimensions: 3840 x 2160
  • Duration: 12 minutes 19 seconds
  • Audio: PCM 24 bit, 48000Hz, 4 channels
  • Preview #1
  • Preview #2

Try Treasured on your damaged MXF files!

Our service offers:

  • FREE diagnostics and preview with Treasured
  • FREE sample of repaired video
  • Try before you buy with a FREE trial of your Repair Kit
  • Enjoy FREE customer support by speaking directly with our trained experts
  • Invaluable expertise, dedication and second to none customer service
Video Repair app online

Treasured

Video Repair — online

Mac, Windows, Linux

CLICK TO DOWNLOAD APP
app.aeroquartet.com
Click to try

Now, for the most technically inclined of you

Analysis of MXF container

MXF has several strong points:

  • Robustness: It's a very redundant format, which makes the recovery of corrupt files possible
  • Workflow-friendly: It stores timecode and rich metadata, on a per-frame basis.
  • Interoperability: MXF can be read and written by a variety of software, including AVID Media Composer, Adobe Premiere, Sony Vegas, GrassValley EDIUS and Final Cut

RAW workflows used in high-end productions often use MXF in capture, color-grading and editing stages.

Structure of MXF files

To analyze MXF files, you can use several utilities.

For example, MXFDump comes bundled with AVID Media Composer.
In macOS, this utility is installed in this folder:
/Applications/Utilities/AVID Utilities Dumpers

The first page of a “dump” looks like this: (see below)

	[ K = Header ( 0000000000000000 )
	06.0e.2b.34.02.05.01.01.0d.01.02.01.01.02.04.00, L =        136 (88) ]
	       Major Version = 0001
	       Minor Version = 0003
	             KAGSize = 00000200
	       ThisPartition = 0000000000000000
	   PreviousPartition = 0000000000000000
	     FooterPartition = 0000000005b4a400
	     HeaderByteCount = 0000000000014000
	      IndexByteCount = 0000000000000000
	            IndexSID = 00000000
	          BodyOffset = 0000000000000000
	             BodySID = 00000000
	 Operational Pattern = 06.0e.2b.34.04.01.01.01.0d.01.02.01.01.01.09.00
	                     = [ 1a - Single Item, Single Package ]
	   EssenceContainers = [ count =          3 ]
	                   0 = 06.0e.2b.34.04.01.01.02.0d.01.03.01.02.04.60.01
	                     = [ MPEG Elementary Stream - stream id 0x60 (frame wrapped) ]
	                   1 = 06.0e.2b.34.04.01.01.01.0d.01.03.01.02.06.03.00
	                     = [ AES3/BWF - AES3 (frame wrapped) ]
	                   2 = 06.0e.2b.34.04.01.01.03.0d.01.03.01.02.7f.01.00
	                     = [ Not recognized ]
	
	[ K = KLVFill ( 000000000000009c )
	06.0e.2b.34.01.01.01.02.03.01.02.10.01.00.00.00, L =        336 (150) ]
	
	[ K = Primer ( 0000000000000200 )
	06.0e.2b.34.02.05.01.01.0d.01.02.01.01.05.01.00, L =       1736 (6c8) ]
	  [ Number of entries =         96, Entry size        =         18 ]
	  Local Tag      UID
	  02.01     :    06.0e.2b.34.01.01.01.02.04.07.01.00.00.00.00.00

Note that information is structured in “atoms” that have the following attributes:

  • Atom Type Ex: Header, KLV Fill, Primer, ...
  • Atom Signature Ex: 060e2b34 02050101 0d010201 01020400 for Header (always 16 bytes starting with 06 0e 2b 34 word.
  • Atom Address and Length Ex: KLVFill starts at address 0x9c and has a length of 336 bytes

The Header atom also declares the video and audio formats used in the file. Here, we have a MPEG Elementary Stream (actually XDCAM HD422) and AES3 audio (Linear PCM).
KLVFill atoms don't contain information. They just add padding so that the next atom starts on a “round” address, like 0x200 for Primer.

CFast 2.0

MXF can be recovered from
any type of card or drive

Top-Level Structures

We have 4 top-level structures.

Header
Body
  IndexTableSegment
    SystemMetadata
    Essence Element (Video)
    Essence Element x number of Audio channels
    ...
    ... repeat x number of video frames
Footer
RandomIndexMetadata
  • Header and Footer are almost identical. They declare all the audio and video settings, and how tracks are organized.
  • Body is by far the biggest section of the file. It contains one or several indexes and frames made of a SystemMetadata and several Essence Elements. Essence Elements is where actual media is stored.
  • An optional RandomIndexMetadata will optimize random access inside the video file.

Header and Footer

Header and Footage contain complex substructures: (KLVFill atoms have been omitted for clarity)

Header
  Primer
  MXFPreface
  MXFIdentification
  MXFContentStorage
  MXFMaterialPackage
     x times (one per track)
       MXFTrack
       MXFSequence
       MXFSourceClip or MXFTimeCodeComponent
  MXFSourcePackage
     x times (one per track)
       MXFTrack
       MXFSequence
       MXFSourceClip or MXFTimeCodeComponent	
  MXFMultipleDescriptor
  MXFGenericPictureEssenceDescriptor
  x times MXFAES3PCMDescriptor
  Dark Atom (proprietary information)
  MXFEssenceContainerData
  

Some atoms contain information that can easily by understood:

Inside MXFMPEG2VideoDescriptor:
  [ k = DisplayHeight
  32.08, l =     4 (0004) ]
       0  00 00 04 38                                        ...8
  [ k = DisplayWidth
  32.09, l =     4 (0004) ]
       0  00 00 07 80                                        ....
  
Inside MXFTrack:
  [ k = EditRate
  4b.01, l =     8 (0008) ]
       0  00 00 5d c0 00 00 03 e9                            ..].....

Where:

  • 07 80 and 04 38 in hexadecimal represent 1920x1080 resolution (fullHD)
  • 5d c0 and 03 e9 represent 1001/24000, or 23.976 frames per second
Reindexing MXF Canon XF-AVC Sony XAVC

Related Topics

X
X
X

Fixing Corrupt MXF Files

Corrupt MXF files don't have a coherent structure. In the worst case, there is only raw data belonging to the Body section.
Therefore, to repair them, it's necessary to organize the data, re-creating the Header, Body and Footer structures. In other words, reindexing the clip.

Copying and pasting together existing valid structures (from other playable MXF files) won't work, because every MXF file has a unique Body size, duration, and timecode.

To make things worse, audio and video media can be recorded in separate files, causing raw data to be interleaved after a data recovery: You can find an audio frame in the middle of a video frame. Usually those interruptions happen on addresses multiple of 0x80000, but it makes MXF recovery much more difficult.

At Aero Quartet, we have developed MXF repair algorithms for most common situations. If you need to repair corrupt MXF, please download our free diagnostics app Treasured and send us a request.