Manifest-agnostic computations shared by the HLS and DASH generators: the per-track
codec strings, the video resolution, and the peak per-segment bandwidth. Pure, read-only
functions over a fragmented (fragment/2-shaped) tree — one home for the codec/bandwidth
logic so HLS and DASH only format (DRY).
Summary
Functions
Comma-joined RFC 6381 codec string for every track, e.g. avc1.64000a,mp4a.40.2.
Peak per-segment bit rate in bits/sec (integer ceil over the moof spans). Both HLS
BANDWIDTH and DASH @bandwidth are this peak segment rate.
The video resolution as WxH (e.g. 128x96), or nil when audio-only.
Track %ISOMedia.TrackInfo{} structs, video first then audio.
The video track's {width, height}, or nil when there is no video track.
Functions
@spec codecs([ISOMedia.Box.t()]) :: String.t()
Comma-joined RFC 6381 codec string for every track, e.g. avc1.64000a,mp4a.40.2.
@spec peak_bandwidth([ISOMedia.Box.t()]) :: non_neg_integer()
Peak per-segment bit rate in bits/sec (integer ceil over the moof spans). Both HLS
BANDWIDTH and DASH @bandwidth are this peak segment rate.
@spec resolution([ISOMedia.Box.t()]) :: String.t() | nil
The video resolution as WxH (e.g. 128x96), or nil when audio-only.
@spec track_infos([ISOMedia.Box.t()]) :: [ISOMedia.TrackInfo.t()]
Track %ISOMedia.TrackInfo{} structs, video first then audio.
@spec video_dimensions([ISOMedia.Box.t()]) :: {pos_integer(), pos_integer()} | nil
The video track's {width, height}, or nil when there is no video track.