Creating video tracks at 30 frames per second
Configure your time-to-sample atom for 30 frames per second.
Overview
The duration of a video frame is stored in the time-to-sample atom contained within a sample table atom. This duration cannot be interpreted without the media’s time scale, which defines the units-per-second for the duration. In this example, each frame has the same duration, so the time-to-sample atom has one entry, which applies to all video frames in the media.
As long as the ratio between frame duration and media time scale remains 1:30, any combination of values can be used for the duration and time scale. The larger the time scale the shorter the maximum duration. Since a movie defaults to a time scale of 600, this is a good number to use. It is also the least common multiple for 24, 25, and 30, making it handy for much of the math you are likely to encounter when making a movie.
The movie time scale is independent of the media time scale. Since you want to avoid movie edits that don’t land on frame boundaries, it is a good idea to keep the movie time scale and the media time scale the same, or to make the movie time scale an even multiple of the media time scale. The movie time scale is stored in the movie header atom.
With a time scale of 600 in the media header atom, the time-to-sample atom would contain the data values listed in following table.
Field | Value |
|---|---|
Atom size |
|
Atom type |
|
Version/Flags |
|
Number of entries |
|
Sample count |
|
Sample duration |
|
See Also
Describing samples
Sample table atom ('stbl')Seeking with a QuickTime fileSample description atom ('stsd')Time-to-sample atom ('stts')Creating 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')