pub struct VideoVariantSpec {
pub width: u32,
pub height: u32,
pub frame_rate: f64,
pub average_bandwidth_bps: u32,
pub bandwidth_bps: u32,
pub codec_string: String,
pub supplemental_codecs: Option<String>,
pub video_range: Option<&'static str>,
pub relative_dir: String,
pub manifest: CmafTrackManifest,
}Expand description
Description of one video rendition for the master playlist.
Fields§
§width: u32Frame width in pixels (post-scaling, what RESOLUTION= reports).
height: u32Frame height in pixels.
frame_rate: f64Source frame rate. FRAME-RATE= is formatted to 3 decimal
places per Apple’s authoring spec (e.g. 29.970, 60.000).
average_bandwidth_bps: u32Average bitrate in bits per second. Goes in the
AVERAGE-BANDWIDTH= attribute.
bandwidth_bps: u32Peak bitrate in bits per second — BANDWIDTH=. Per RFC 8216
§4.3.4.2 this is the largest single-segment bitrate observed
(or, for VBR encoders without per-segment metering, the
rendition’s nominal max_bitrate). Players use this for ABR
switching headroom decisions.
codec_string: StringAV1 codec string for the video track. Parse from the encoded
bitstream via codec::codec_strings::av1_codec_string. Joined
with the audio codec string in CODECS="...".
supplemental_codecs: Option<String>Optional SUPPLEMENTAL-CODECS attribute string. Per HLS-Authoring
Spec §“Supplemental Codecs”, this carries an enhanced codec
signalling that AUGMENTS the CODECS attribute — e.g. the
dvh1.08.07/db4h form for Dolby Vision Profile 8 over an HEVC
base layer.
For pure AV1 HDR there’s no base+enhancement model (the bitstream IS the HDR content), so the canonical pattern when HDR encode lands (Squad-22 dep) will be parallel SDR + HDR renditions in the master rather than supplemental signalling on a single variant. This field exists so that future supplemental-codec patterns (Dolby Vision over AV1 if/when that becomes a thing, AV2, etc.) can be wired in without a schema change.
Format when set: "<codec>/<compat>[/<compat>...]". None
today; field is plumbed for forward compat.
video_range: Option<&'static str>VIDEO-RANGE attribute on the STREAM-INF. Per HLS spec, allowed
values: “SDR” (default, omitted when at SDR), “HLG”, “PQ”.
Set to Some("PQ") for HDR10 sources, Some("HLG") for HLG.
None for SDR (omitted from output — HLS authors recommend
omitting the attribute when at SDR rather than emitting
VIDEO-RANGE=SDR explicitly).
relative_dir: StringRelative directory under the asset root, e.g. "video/1080p".
The variant’s playlist.m3u8 URI in the master is
<relative_dir>/playlist.m3u8.
manifest: CmafTrackManifestCMAF track manifest produced by the segmenter. Source for the
EXT-X-MAP URI + per-segment EXTINF durations.
Trait Implementations§
Source§impl Clone for VideoVariantSpec
impl Clone for VideoVariantSpec
Source§fn clone(&self) -> VideoVariantSpec
fn clone(&self) -> VideoVariantSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more