pub struct StreamInfo {Show 23 fields
pub index: i32,
pub codec_name: String,
pub codec_long_name: String,
pub codec_type: String,
pub profile: String,
pub width: i32,
pub height: i32,
pub pix_fmt: String,
pub level: i32,
pub field_order: String,
pub color_range: String,
pub color_space: String,
pub color_transfer: String,
pub color_primaries: String,
pub duration: f64,
pub bit_rate: i64,
pub nb_frames: i32,
pub r_frame_rate: String,
pub avg_frame_rate: String,
pub sample_rate: i32,
pub channels: i32,
pub channel_layout: String,
pub bits_per_raw_sample: i32,
}Expand description
Per-stream metadata reported by ffprobe.
Fields§
§index: i32Stream index within the container.
codec_name: StringShort codec name (e.g. "h264").
codec_long_name: StringHuman-readable codec name.
codec_type: StringStream type: "video", "audio", or "subtitle".
profile: StringCodec profile (e.g. "High").
width: i32Pixel width (video).
height: i32Pixel height (video).
pix_fmt: StringPixel format (e.g. "yuv420p").
level: i32Codec level.
field_order: StringField/scan order (e.g. "progressive").
color_range: StringColor range (e.g. "tv"/"pc").
color_space: StringColor matrix / space.
color_transfer: StringColor transfer characteristics (e.g. "smpte2084" for PQ).
color_primaries: StringColor primaries (e.g. "bt2020").
duration: f64Stream duration in seconds.
bit_rate: i64Stream bitrate in bits per second.
nb_frames: i32Number of frames, when known.
r_frame_rate: StringRaw frame rate as a rational string (e.g. "25/1").
avg_frame_rate: StringAverage frame rate as a rational string (e.g. "25/1").
sample_rate: i32Audio sample rate in Hz.
channels: i32Audio channel count.
channel_layout: StringAudio channel layout (e.g. "stereo").
bits_per_raw_sample: i32Bits per raw sample (used to detect high-bit-depth/HDR content).
Implementations§
Source§impl StreamInfo
impl StreamInfo
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Returns an error unless this is a video stream with positive dimensions.
Sourcepub fn resolution_str(&self) -> String
pub fn resolution_str(&self) -> String
Returns "WIDTHxHEIGHT", or an empty string if dimensions are unknown.
Trait Implementations§
Source§impl Clone for StreamInfo
impl Clone for StreamInfo
Source§fn clone(&self) -> StreamInfo
fn clone(&self) -> StreamInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more