Sample description atom ('stsd')
An atom that stores information that allows you to decode samples in the media.
Mentioned in
Overview
The data stored in the sample description varies, depending on the media type. For example, in the case of video media, the sample descriptions are image description structures. The sample description information for each media type is explained in Media data atom types.
The layout of the sample description atom is as follows.
Sample description atom data field | Bytes |
|---|---|
4 | |
Type = | 4 |
1 | |
3 | |
4 | |
Variable |
The sample description atom has an atom type of 'stsd'. The sample description atom contains a table of sample descriptions. A media may have one or more sample descriptions, depending upon the number of different encoding schemes used in the media and on the number of files used to store the data. The sample-to-chunk atom identifies the sample description for each sample in the media by specifying the index into this table for the appropriate description (see Sample-to-chunk atom ('stsc')).
General structure of a sample description
While the exact format of the sample description varies by media type, the first four fields of every sample description are the same.
- Sample description size
A 32-bit integer indicating the number of bytes in the sample description.
- Data format
A 32-bit integer indicating the format of the stored data. This depends on the media type, but is usually either the compression format or the media type.
- Reserved
Six bytes that must be set to
0.- Data reference index
A 16-bit integer that contains the index of the data reference to use to retrieve data associated with samples that use this sample description. Data references are stored in data reference atoms.
These four fields may be followed by additional data specific to the media type and data format. See Media data atom types for additional details regarding specific media types and media formats.
Topics
Data fields
See Also
Describing samples
Sample table atom ('stbl')Seeking with a QuickTime fileTime-to-sample atom ('stts')Creating video tracks at 30 frames per secondCreating video tracks at 29.97 frames per secondCreating sound tracks at 44.1 kHzComposition offset atom ('ctts')Composition shift least greatest atom ('cslg')Using composition offset and composition shift least greatest atomsSync sample atom ('stss')Partial sync sample atom ('stps')Sample-to-chunk atom ('stsc')Referencing two data files with a single trackSample size atom ('stsz')Chunk offset atom ('stco')