pub struct RenditionSpec {
pub name: String,
pub width: u32,
pub height: u32,
pub video_bitrate_kbps: u32,
pub audio_bitrate_kbps: u32,
}Expand description
One rendition in an ABR ladder. Carries the target geometry + bitrates a downstream encoder uses to produce output fragments.
Session 104 A captures only the minimum set every software + hardware encoder consumes. Session 105 B extends this with codec-specific knobs (x264 profile / tune / keyint, NVENC quality preset, VideoToolbox pixel format) layered on rather than replacing these fields, so existing consumers stay source-compatible.
Fields§
§name: StringShort human-readable identifier ("720p" / "480p" /
"240p"). Used as:
- The rendition suffix on the output broadcast name
(
<source>/<name>). - A Prometheus metric label
(
lvqr_transcode_fragments_total{rendition="720p"}). - The HLS master-playlist
NAME=attribute (landed in session 106 C).
Pick something short, lowercase, no slashes. Validation is the operator’s responsibility for now; session 106 C’s CLI flag will enforce the character set.
width: u32Target frame width in pixels. Downstream encoders use this
to configure the videoscale element (or the hardware
encoder’s equivalent).
height: u32Target frame height in pixels.
video_bitrate_kbps: u32Target video bitrate in kilobits / second. Upstream to the
encoder’s bitrate property. Typical 720p h264 lands at
2-3 Mb/s; 480p at 1-1.5 Mb/s; 240p at 300-500 kb/s.
audio_bitrate_kbps: u32Target audio bitrate in kilobits / second. Upstream to the audio encoder (AAC in 105 B) or passed through when the rendition reuses the source audio track. 96-128 kb/s at 48 kHz stereo is the typical range.
Implementations§
Source§impl RenditionSpec
impl RenditionSpec
Sourcepub fn new(
name: impl Into<String>,
width: u32,
height: u32,
video_bitrate_kbps: u32,
audio_bitrate_kbps: u32,
) -> Self
pub fn new( name: impl Into<String>, width: u32, height: u32, video_bitrate_kbps: u32, audio_bitrate_kbps: u32, ) -> Self
Construct a custom rendition with the supplied fields.
Sourcepub fn preset_720p() -> Self
pub fn preset_720p() -> Self
720p preset: 1280x720 at 2.5 Mb/s video + 128 kb/s audio.
Matches the tracking/TIER_4_PLAN.md section 4.6 default.
Sourcepub fn preset_480p() -> Self
pub fn preset_480p() -> Self
480p preset: 854x480 at 1.2 Mb/s video + 96 kb/s audio.
Sourcepub fn preset_240p() -> Self
pub fn preset_240p() -> Self
240p preset: 426x240 at 400 kb/s video + 64 kb/s audio.
Sourcepub fn default_ladder() -> Vec<Self>
pub fn default_ladder() -> Vec<Self>
Default 3-rung LVQR ladder, ordered highest-to-lowest so
operators reading logs or admin output see the ladder’s
top rung first. HLS master-playlist composition in
session 106 C sorts independently by BANDWIDTH.
Trait Implementations§
Source§impl Clone for RenditionSpec
impl Clone for RenditionSpec
Source§fn clone(&self) -> RenditionSpec
fn clone(&self) -> RenditionSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RenditionSpec
impl Debug for RenditionSpec
Source§impl<'de> Deserialize<'de> for RenditionSpec
impl<'de> Deserialize<'de> for RenditionSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RenditionSpec
impl PartialEq for RenditionSpec
Source§fn eq(&self, other: &RenditionSpec) -> bool
fn eq(&self, other: &RenditionSpec) -> bool
self and other values to be equal, and is used by ==.