pub struct SourceFormat {
pub pix_fmt: String,
pub bit_depth: u8,
pub color_primaries: String,
pub color_transfer: String,
pub color_space: String,
pub is_hdr: bool,
pub hdr10: Option<Hdr10Metadata>,
}Expand description
Snapshot of source video color characteristics for encode preservation.
Fields§
§pix_fmt: StringPreferred output pixel format (e.g. yuv420p10le).
bit_depth: u8Effective bit depth (8, 10, 12, or 16).
color_primaries: StringColor primaries from probe (e.g. bt2020).
color_transfer: StringColor transfer from probe (e.g. smpte2084).
color_space: StringColor matrix / space from probe.
is_hdr: boolWhether the stream carries HDR signaling.
hdr10: Option<Hdr10Metadata>HDR10 static metadata (mastering display + MaxCLL/MaxFALL), when probed.
Implementations§
Source§impl SourceFormat
impl SourceFormat
Sourcepub fn from_stream(stream: &StreamInfo) -> Self
pub fn from_stream(stream: &StreamInfo) -> Self
Builds a format snapshot from a probed video stream.
Sourcepub fn is_high_bit_depth(&self) -> bool
pub fn is_high_bit_depth(&self) -> bool
Returns true when the source should be encoded at more than 8 bits per sample.
Sourcepub async fn enrich_hdr10(self, path: &str) -> Self
pub async fn enrich_hdr10(self, path: &str) -> Self
Probes and attaches HDR10 static metadata (mastering display + MaxCLL) when the source is HDR, so it can be re-signalled on the encode.
A no-op for SDR sources. Probe failures are swallowed (best-effort): a missing mastering-display block degrades to colour-primary signalling rather than failing the encode.
Trait Implementations§
Source§impl Clone for SourceFormat
impl Clone for SourceFormat
Source§fn clone(&self) -> SourceFormat
fn clone(&self) -> SourceFormat
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 SourceFormat
impl Debug for SourceFormat
Source§impl Default for SourceFormat
impl Default for SourceFormat
Source§fn default() -> SourceFormat
fn default() -> SourceFormat
impl Eq for SourceFormat
Source§impl PartialEq for SourceFormat
impl PartialEq for SourceFormat
Source§fn eq(&self, other: &SourceFormat) -> bool
fn eq(&self, other: &SourceFormat) -> bool
self and other values to be equal, and is used by ==.