<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "QuickTime File Format",
  "identifier" : "/documentation/quicktime-file-format/Sample_description_atom",
  "metadataVersion" : "0.1.0",
  "role" : "Atom",
  "symbol" : {
    "kind" : "Atom",
    "modules" : [
      "QuickTime File Format"
    ],
    "preciseIdentifier" : "__docc_universal_symbol_reference_$Sample_description_atom"
  },
  "title" : "Sample description atom ('stsd')"
}
-->

# Sample description atom ('stsd')

An atom that stores information that allows you to decode samples in the media.

## 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](/documentation/QuickTime-File-Format/Media_data_atom_types).

The layout of the sample description atom is as follows.

|Sample description atom data field                                                                           |Bytes   |
|-------------------------------------------------------------------------------------------------------------|--------|
|``doc://com.apple.qtff/documentation/quicktime-file-format/Sample_description_atom/Size``                    |4       |
|``doc://com.apple.qtff/documentation/quicktime-file-format/Sample_description_atom/Type`` = `'stsd'`         |4       |
|``doc://com.apple.qtff/documentation/quicktime-file-format/Sample_description_atom/Version``                 |1       |
|``doc://com.apple.qtff/documentation/quicktime-file-format/Sample_description_atom/Flags``                   |3       |
|``doc://com.apple.qtff/documentation/quicktime-file-format/Sample_description_atom/Number_of_entries``       |4       |
|``doc://com.apple.qtff/documentation/quicktime-file-format/Sample_description_atom/Sample_description_table``|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`](/documentation/quicktime-file-format/Sample-to-chunk_atom)).

## 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.

> Important: When parsing sample descriptions in the `‘stsd’` atom, be aware of the sample description size value in order to read each table entry correctly. Some sample descriptions terminate with four zero bytes that are not otherwise indicated.

- 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](/documentation/QuickTime-File-Format/Media_data_atom_types) for additional details regarding specific media types and media formats.

## Topics

### Data fields

[`Size`](/documentation/quicktime-file-format/Sample_description_atom/Size)

A 32-bit integer that specifies the number of bytes in this sample description atom.

[`Type`](/documentation/quicktime-file-format/Sample_description_atom/Type)

A 32-bit integer that identifies the atom type.

[`Version`](/documentation/quicktime-file-format/Sample_description_atom/Version)

A 1-byte specification of the version of this sample description atom.

[`Flags`](/documentation/quicktime-file-format/Sample_description_atom/Flags)

A 3-byte space for sample description flags.

[`Number of entries`](/documentation/quicktime-file-format/Sample_description_atom/Number_of_entries)

A 32-bit integer containing the number of sample descriptions that follow.

[`Sample description table`](/documentation/quicktime-file-format/Sample_description_atom/Sample_description_table)

An array of sample descriptions.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)