FileTsOutputSettings.segmentIndex property

Index the file as it is written: report where each segment starts, via FileTsOutputSettings.onSegmentStart. Absent (the default), no index is kept and nothing is reported.

A segment starts on the first random access point at least segmentDurationMs (minimum 1000) after the previous start: a video keyframe, or on an audio-only stream an audio frame. Each starts with PAT/PMT, so the bytes from one start to the next decode on their own, e.g. as an HLS EXT-X-BYTERANGE segment. With an index, rollover waits for the next segment start, so every file opens on one.

Signature:

segmentIndex?: {
        segmentDurationMs: number;
    };