[FFmpeg-devel] [PATCH] libavformat/mxfdec.c: initial support for EssenceGroups

Mark Reid mindmark at gmail.com
Wed Nov 26 00:14:36 CET 2014

This patch adds support for demuxing mxf files with Essence Groups. 
An essence group according to the AAF Spec "contains multiple representations 
of the same media."  Its like a sequence only each component is a different choice
of quality levels.

basically instead of

its like this:
|---SourceClip1 high quality
|---SoucceClip2 med quality
|---SourceClip3 low quality

MXF files generated by Media Composer that contain titles, alpha mattes and I 
think just rendered effects seem to use EssenceGroups in FilePackages instead of just
SourceClips. The current implementation just picks the first SourceClip whose 
SourcePackage has a valid Descriptor. There is some hackery to set correct 
the duration of the SourceClip that I'm still trying to sort out. The samples 
I have are single frames and the SourceClip->duration is set to how long the frame should
hold for and not the duration of the actual essence material. The actual duration 
of the essence material can be retrieved in optional FileDescriptor->ContainerDuration 

Also added a mxf_metadataset_init function to set defaults on metadataset 
items just after they are created. The descriptor->pix_fmt of was always getting 
reset to AV_PIX_FORMAT_NONE even if the descriptor contains one.
This was causing me some issues detecting the correct pix_fmt a RGBADescriptors.

The fate-lavf-mxf tests needed to be updated again because I added a 
MXFMetadataSetType enum and mxfenc.c uses uses the enum values to generate InstanceUIDs 

I uploaded 3 sample mxf files that contain essence groups to ftp://upload.ffmpeg.org

essencegroup_color_dnxhd.mxf (its encoded unpremultiplied)
essencegroup_alpha_dnxhd.mxf (alpha inverted)
essencegroup_alpha_raw.mxf  (uncompressed single channel image AV_PIX_FMT_GRAY8)

Mark Reid (1):
  libavformat/mxfdec.c: initial support for EssenceGroups

 libavformat/mxf.c      |   1 +
 libavformat/mxf.h      |   1 +
 libavformat/mxfdec.c   | 148 ++++++++++++++++++++++++++++++++++++++++---------
 tests/ref/lavf/mxf     |   6 +-
 tests/ref/lavf/mxf_d10 |   2 +-
 5 files changed, 127 insertions(+), 31 deletions(-)


More information about the ffmpeg-devel mailing list