ISOMedia.SampleTable (ISOMedia v0.1.0)

Copy Markdown View Source

Decodes a track's stbl sample tables into an ordered list of ISOMedia.Sample.

Cross-references stsz (sizes), stsc (sample→chunk runs), stco/co64 (chunk offsets), stts (decode-time deltas), optional ctts (composition offsets) and stss (sync samples). Raises on stz2 (unsupported) or a missing required table.

Summary

Functions

Decode a trak box into [%ISOMedia.Sample{}].

Encode a ctts box from per-sample composition offsets, or nil if all zero.

Encode a stsc box from per-chunk sample counts (chunk order, 1-based chunks).

Encode a stss box from 1-based sync sample positions.

Encode a stsz box from explicit per-sample sizes.

Encode a stts box from a per-sample duration list (run-length encoded).

Functions

build(trak)

Decode a trak box into [%ISOMedia.Sample{}].

build_ctts(offsets)

Encode a ctts box from per-sample composition offsets, or nil if all zero.

build_stsc(per_chunk_counts)

Encode a stsc box from per-chunk sample counts (chunk order, 1-based chunks).

build_stss(positions)

Encode a stss box from 1-based sync sample positions.

build_stsz(sizes)

Encode a stsz box from explicit per-sample sizes.

build_stts(durations)

Encode a stts box from a per-sample duration list (run-length encoded).