ISOMedia.Trim (ISOMedia v0.1.0)

Copy Markdown View Source

Losslessly trim every track to a time range [start_sec, end_sec).

Per track: select samples by decode time (snap the start back to the nearest keyframe), rebuild all sample tables from the kept set, and re-base the timeline to zero. Kept chunk-runs from all tracks are written to a new mdat sorted by their original file offset, preserving A/V interleave. Duration headers are updated. Memory-safe: the new mdat is a segment list.

Summary

Functions

Trim every track to [start_sec, end_sec). Returns a new box tree.

Functions

trim(boxes, start_sec, end_sec)

Trim every track to [start_sec, end_sec). Returns a new box tree.