<!--
{
  "documentType" : "article",
  "framework" : "QuickTime File Format",
  "identifier" : "/documentation/QuickTime-File-Format/Constant-size_timed_metadata_sample_data",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Constant-size timed metadata sample data"
}
-->

# Constant-size timed metadata sample data

Create metadata tracks with samples that have the same size.

## Overview

Some clients using timed metadata tracks may prefer to create metadata tracks with samples that have the same size. Two approaches are described here.

In one approach, the metadata written might contain a fixed number of fixed-sized metadata values (for example, integers or statically sized structures). If one or more values are not used, atoms corresponding to unused values can have their `local_key_id` value set to an unreferenced value (such as `0`).

In the second approach, the size of individual metadata values may vary. It is possible to create constant-sized metadata samples by determining a maximum timed metadata media sample size and using unreferenced atoms to add up to this size. The approach is:

1. Determine the constant metadata media atom size desired.
2. Fill in the atoms holding metadata values (see the Timed metadata media sample structure example in [Timed metadata sample data format](/documentation/QuickTime-File-Format/Timed_metadata_sample_data_format)).
3. If necessary, add one or more unreferenced atoms to reach the constant metadata media atom size.

> Note: Because an atom has a minimum size of 8 bytes, the sum of the sizes of contained timed metadata media samples either must equal the target constant metadata media atom size, or must be 8 or more bytes smaller than the target constant atom size to allow for one or more padding atoms.

## Unreferenced or NULL timed metadata sample data

A timed metadata sample is identified by its derived atom type supplied by the `local_key_id` value in the metadata sample description’s key tables. An unreferenced metadata atom, meaning one which is not identified in the key tables and not having the reserved value `0xFFFFFFFF`, can be considered a “NULL” metadata media sample since its type is unknown in the local namespace and its data will not be interpreted. There is no prescribed atom type indicating a NULL metadata sample although a type of `0` is recommended, as mentioned in the [`Metadata key atom`](/documentation/quicktime-file-format/Metadata_key_atom) description. Using unreferenced atoms presents a useful way to supply padding when structuring a track for constant-sized metadata sample data or when there are runs of no-metadata interspersed with runs of metadata in a given track, instead of using multiple track edits.

---

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)