pub struct SourceProperties {
pub codec: String,
pub width: u32,
pub height: u32,
pub fps_num: u32,
pub fps_den: u32,
pub sample_rate: u32,
pub audio_codec: String,
}Expand description
Codec and format properties of a single source segment.
Obtained by probing the source file before planning. Filling in accurate values is the caller’s responsibility; the planner uses these to decide whether re-encoding is necessary.
Fields§
§codec: StringVideo codec identifier (e.g. "h264", "vp9", "av1").
width: u32Frame width in pixels.
height: u32Frame height in pixels.
fps_num: u32Frame rate numerator.
fps_den: u32Frame rate denominator.
sample_rate: u32Audio sample rate in Hz.
audio_codec: StringAudio codec identifier (e.g. "aac", "opus").
Implementations§
Source§impl SourceProperties
impl SourceProperties
Sourcepub fn resolution(&self) -> (u32, u32)
pub fn resolution(&self) -> (u32, u32)
Returns (width, height).
Sourcepub fn fps(&self) -> f64
pub fn fps(&self) -> f64
Returns the frame rate as a floating-point number.
Returns 0.0 when fps_den is zero.
Sourcepub fn is_compatible_with(&self, other: &Self) -> bool
pub fn is_compatible_with(&self, other: &Self) -> bool
Returns true when other has the same video codec, resolution,
frame rate, audio codec, and sample rate.
Trait Implementations§
Source§impl Clone for SourceProperties
impl Clone for SourceProperties
Source§fn clone(&self) -> SourceProperties
fn clone(&self) -> SourceProperties
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceProperties
impl Debug for SourceProperties
Source§impl PartialEq for SourceProperties
impl PartialEq for SourceProperties
impl Eq for SourceProperties
impl StructuralPartialEq for SourceProperties
Auto Trait Implementations§
impl Freeze for SourceProperties
impl RefUnwindSafe for SourceProperties
impl Send for SourceProperties
impl Sync for SourceProperties
impl Unpin for SourceProperties
impl UnsafeUnpin for SourceProperties
impl UnwindSafe for SourceProperties
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more