ISOMedia.FragmentIndex (ISOMedia v0.1.0)

Copy Markdown View Source

Indexes fragmented MP4 (moof/traf/trun) into the same [%ISOMedia.Sample{}] the progressive indexer produces. Offsets are resolved tree-locally (a single Layout walk stamps each moof's position), and the cascade trun → tfhd → trex resolves per-sample duration/size/flags. chunk_index is a per-trun counter.

Summary

Functions

True when the tree is fragmented: has a moov/mvex and at least one moof.

Resolve one trun's per-sample fields against merged defaults (%{duration, size, flags}, already tfhd-over-trex). Returns [%{duration, size, composition_offset, sync?}]. sync? negates the sample_is_non_sync_sample bit.

Index the fragmented track track_id into [%ISOMedia.Sample{}].

Functions

fragmented?(boxes)

True when the tree is fragmented: has a moov/mvex and at least one moof.

resolve_run(trun, defaults)

Resolve one trun's per-sample fields against merged defaults (%{duration, size, flags}, already tfhd-over-trex). Returns [%{duration, size, composition_offset, sync?}]. sync? negates the sample_is_non_sync_sample bit.

samples(boxes, track_id)

Index the fragmented track track_id into [%ISOMedia.Sample{}].