StreamInfo

Struct StreamInfo 

Source
pub struct StreamInfo {
Show 46 fields pub index: u32, pub codec_name: Option<String>, pub codec_long_name: Option<String>, pub profile: Option<String>, pub codec_type: Option<String>, pub codec_tag_string: Option<String>, pub codec_tag: Option<String>, pub width: Option<u32>, pub height: Option<u32>, pub coded_width: Option<u32>, pub coded_height: Option<u32>, pub has_b_frames: Option<u32>, pub sample_aspect_ratio: Option<String>, pub display_aspect_ratio: Option<String>, pub pix_fmt: Option<String>, pub level: Option<i32>, pub color_range: Option<String>, pub color_space: Option<String>, pub color_transfer: Option<String>, pub color_primaries: Option<String>, pub chroma_location: Option<String>, pub field_order: Option<String>, pub refs: Option<u32>, pub is_avc: Option<String>, pub nal_length_size: Option<String>, pub sample_fmt: Option<String>, pub sample_rate: Option<String>, pub channels: Option<u32>, pub channel_layout: Option<String>, pub bits_per_sample: Option<u32>, pub id: Option<String>, pub r_frame_rate: Option<String>, pub avg_frame_rate: Option<String>, pub time_base: Option<String>, pub start_pts: Option<i64>, pub start_time: Option<String>, pub duration_ts: Option<i64>, pub duration: Option<String>, pub bit_rate: Option<String>, pub max_bit_rate: Option<String>, pub bits_per_raw_sample: Option<u32>, pub nb_frames: Option<String>, pub nb_read_frames: Option<String>, pub nb_read_packets: Option<String>, pub disposition: Option<HashMap<String, u8>>, pub tags: HashMap<String, String>,
}
Expand description

Stream information

Fields§

§index: u32

Stream index

§codec_name: Option<String>

Codec name

§codec_long_name: Option<String>

Codec long name

§profile: Option<String>

Profile

§codec_type: Option<String>

Codec type (video/audio/subtitle/data)

§codec_tag_string: Option<String>

Codec tag string

§codec_tag: Option<String>

Codec tag

§width: Option<u32>

Width

§height: Option<u32>

Height

§coded_width: Option<u32>

Coded width

§coded_height: Option<u32>

Coded height

§has_b_frames: Option<u32>

Has B frames

§sample_aspect_ratio: Option<String>

Sample aspect ratio

§display_aspect_ratio: Option<String>

Display aspect ratio

§pix_fmt: Option<String>

Pixel format

§level: Option<i32>

Level

§color_range: Option<String>

Color range

§color_space: Option<String>

Color space

§color_transfer: Option<String>

Color transfer

§color_primaries: Option<String>

Color primaries

§chroma_location: Option<String>

Chroma location

§field_order: Option<String>

Field order

§refs: Option<u32>

References

§is_avc: Option<String>

Is AVC

§nal_length_size: Option<String>

NAL length size

§sample_fmt: Option<String>

Sample format

§sample_rate: Option<String>

Sample rate

§channels: Option<u32>

Number of channels

§channel_layout: Option<String>

Channel layout

§bits_per_sample: Option<u32>

Bits per sample

§id: Option<String>

Stream ID

§r_frame_rate: Option<String>

Frame rate ratio

§avg_frame_rate: Option<String>

Average frame rate

§time_base: Option<String>

Time base

§start_pts: Option<i64>

Start PTS

§start_time: Option<String>

Start time

§duration_ts: Option<i64>

Duration timestamp

§duration: Option<String>

Duration

§bit_rate: Option<String>

Bit rate

§max_bit_rate: Option<String>

Max bit rate

§bits_per_raw_sample: Option<u32>

Bits per raw sample

§nb_frames: Option<String>

Number of frames

§nb_read_frames: Option<String>

Number of read frames

§nb_read_packets: Option<String>

Number of read packets

§disposition: Option<HashMap<String, u8>>

Disposition flags

§tags: HashMap<String, String>

Tags/metadata

Implementations§

Source§

impl StreamInfo

Source

pub fn is_video(&self) -> bool

Check if this is a video stream

Source

pub fn is_audio(&self) -> bool

Check if this is an audio stream

Source

pub fn is_subtitle(&self) -> bool

Check if this is a subtitle stream

Source

pub fn language(&self) -> Option<&str>

Get the language tag

Source

pub fn title(&self) -> Option<&str>

Get the title tag

Source

pub fn resolution(&self) -> Option<(u32, u32)>

Get resolution as (width, height)

Source

pub fn frame_rate(&self) -> Option<f64>

Get frame rate as f64

Source

pub fn sample_rate_hz(&self) -> Option<u32>

Get sample rate as u32

Source

pub fn duration_seconds(&self) -> Option<f64>

Get duration as f64 seconds

Source

pub fn bit_rate_bps(&self) -> Option<u64>

Get bit rate as u64

Trait Implementations§

Source§

impl Clone for StreamInfo

Source§

fn clone(&self) -> StreamInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StreamInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StreamInfo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for StreamInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for StreamInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,