pub struct StreamInfo {
pub index: usize,
pub codec: CodecId,
pub media_type: MediaType,
pub timebase: Rational,
pub duration: Option<i64>,
pub codec_params: CodecParams,
pub metadata: Metadata,
}Expand description
Information about a stream in a container.
Each stream in a container has associated metadata including codec, timebase, and format-specific parameters.
Fields§
§index: usizeStream index (0-based).
codec: CodecIdCodec used for this stream.
media_type: MediaTypeType of media in this stream.
timebase: RationalTimebase for interpreting timestamps.
Timestamps are expressed as multiples of this rational number. For example, a timebase of 1/1000 means timestamps are in milliseconds.
duration: Option<i64>Duration of the stream in timebase units, if known.
codec_params: CodecParamsCodec-specific parameters.
metadata: MetadataStream metadata (title, language, etc.).
Implementations§
Source§impl StreamInfo
impl StreamInfo
Sourcepub fn new(index: usize, codec: CodecId, timebase: Rational) -> Self
pub fn new(index: usize, codec: CodecId, timebase: Rational) -> Self
Creates a new StreamInfo with the given parameters.
Sourcepub fn duration_seconds(&self) -> Option<f64>
pub fn duration_seconds(&self) -> Option<f64>
Returns the duration in seconds, if known.
Sourcepub const fn is_subtitle(&self) -> bool
pub const fn is_subtitle(&self) -> bool
Returns true if this is a subtitle stream.
Trait Implementations§
Source§impl Clone for StreamInfo
impl Clone for StreamInfo
Source§fn clone(&self) -> StreamInfo
fn clone(&self) -> StreamInfo
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 moreAuto Trait Implementations§
impl !Freeze for StreamInfo
impl RefUnwindSafe for StreamInfo
impl Send for StreamInfo
impl Sync for StreamInfo
impl Unpin for StreamInfo
impl UnsafeUnpin for StreamInfo
impl UnwindSafe for StreamInfo
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