ISOMedia.Manifest (ISOMedia v0.2.0)

Copy Markdown View Source

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

codecs(boxes)

@spec codecs([ISOMedia.Box.t()]) :: String.t()

Comma-joined RFC 6381 codec string for every track, e.g. avc1.64000a,mp4a.40.2.

peak_bandwidth(boxes)

@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.

resolution(boxes)

@spec resolution([ISOMedia.Box.t()]) :: String.t() | nil

The video resolution as WxH (e.g. 128x96), or nil when audio-only.

track_infos(boxes)

@spec track_infos([ISOMedia.Box.t()]) :: [ISOMedia.TrackInfo.t()]

Track %ISOMedia.TrackInfo{} structs, video first then audio.

video_dimensions(boxes)

@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.