8.6.1.2.1 Definition
Box Type: ‘stts’
Container: Sample Table Box (‘stbl’)
Mandatory: Yes
Quantity: Exactly one
This box contains a compact version of a table that allows indexing from decoding time to sample
number. Other tables give sample sizes and pointers, from the sample number. Each entry in the table
gives the number of consecutive samples with the same time delta, and the delta of those samples. By
adding the deltas a complete time‐to‐sample map may be built.
The Decoding Time to Sample Box contains decode time delta’s: DT(n+1) = DT(n) + STTS(n) where
STTS(n) is the (uncompressed) table entry for sample n.
The sample entries are ordered by decoding time stamps; therefore the deltas are all non‐negative.
The DT axis has a zero origin; DT(i) = SUM(for j=0 to i‐1 of delta(j)), and the sum of all deltas gives the
length of the media in the track (not mapped to the overall timescale, and not considering any edit list).
The Edit List Box provides the initial CT value if it is non‐empty (non‐zero).
http://wikil.lwwhome.cn:28080/wp-content/uploads/2020/04/0000ff_30s_11280x720.mp4
0000f250: 00 01 00 00 00 18 73 74 74 73 00 00 00 00 00 00 ……stts……
0000f260: 00 01 00 00 05 dc 00 00 02 00 00 00 00 28 73 74 ………….(st
0000f270: 73 73 00 00 00 00 00 00 00 06 00 00 00 01 00 00 ss…………..
aligned(8) class TimeToSampleBox extends FullBox('stts', version = 0, 0) { unsigned int(32) entry_count; int i; for (i=0; i < entry_count; i++) { unsigned int(32) sample_count; unsigned int(32) sample_delta; } }
00 00 00 01 //unsigned int(32) entry_count;
00 00 05 dc //unsigned int(32) sample_count;
00 00 02 00 //unsigned int(32) sample_delta;