Contents of the CodecPrivate data for V_QUICKTIME

For all QuickTime codecs the CodecID V_QUICKTIME is used, which is the QuickTime compatibility mode. In this mode the CodecPrivate data contains the complete contents of the 'stsd' (sample description) atom from the QuickTime file. The following structure describes these contents:

typedef struct {
  uint32_t size;
  char fourcc[4];
  uint8_t reserved[6];
  uint16_t data_reference_index;
  uint16_t version;
  uint16_t revision;
  uint32_t vendor;
  uint32_t temporal_quality;
  uint32_t spatial_quality;
  uint16_t width;
  uint16_t height;
  uint32_t horizontal_resolution; // 32bit fixed-point number
  uint32_t vertical_resolution; // 32bit fixed-point number
  uint32_t data_size;
  uint16_t frame_count;
  char compressor_name[32];
  uint16_t depth;
  uint16_t color_table_id;
} video_stsd_atom_t;

All fields are stored in big endian byte order. If the size field is bigger than sizeof(video_stsd_atom_t) then the codec needs some private data which is located directly after this structure.

The fourcc field contains the FourCC of the codec used, e.g. SVQ3 for the popular Sorenson 3 codec or cvid for Cinepak.

The contents of the width and height fields must be the same as the corresponding Matroska elements (PixelWidth and PixelHeight).