pub struct VideoMetadata {Show 14 fields
pub format: ContainerFormat,
pub duration: Duration,
pub fps: f64,
pub width: usize,
pub height: usize,
pub frame_count: usize,
pub video_codec: String,
pub pixel_format: PixelFormat,
pub rotation: u32,
pub bit_rate: u64,
pub streams: Vec<StreamInfo>,
pub has_audio: bool,
pub has_subtitles: bool,
pub file_size: u64,
}Expand description
Complete metadata for a video file.
Fields§
§format: ContainerFormatContainer format.
duration: DurationVideo duration.
fps: f64Frame rate in frames per second.
width: usizeWidth in pixels.
height: usizeHeight in pixels.
frame_count: usizeTotal number of frames.
video_codec: StringVideo codec.
pixel_format: PixelFormatPixel format.
rotation: u32Rotation angle in degrees.
bit_rate: u64Total bit rate.
streams: Vec<StreamInfo>All streams in the file.
has_audio: boolWhether the video has audio.
has_subtitles: boolWhether the video has subtitles.
file_size: u64File size in bytes.
Implementations§
Source§impl VideoMetadata
impl VideoMetadata
Sourcepub fn synthetic(
width: usize,
height: usize,
fps: f64,
frame_count: usize,
) -> Self
pub fn synthetic( width: usize, height: usize, fps: f64, frame_count: usize, ) -> Self
Creates metadata for a synthetic/test video.
Sourcepub fn aspect_ratio(&self) -> f64
pub fn aspect_ratio(&self) -> f64
Returns the aspect ratio (width / height).
Sourcepub fn video_stream_count(&self) -> usize
pub fn video_stream_count(&self) -> usize
Returns the total number of video streams.
Sourcepub fn audio_stream_count(&self) -> usize
pub fn audio_stream_count(&self) -> usize
Returns the total number of audio streams.
Trait Implementations§
Source§impl Clone for VideoMetadata
impl Clone for VideoMetadata
Source§fn clone(&self) -> VideoMetadata
fn clone(&self) -> VideoMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 VideoMetadata
impl RefUnwindSafe for VideoMetadata
impl Send for VideoMetadata
impl Sync for VideoMetadata
impl Unpin for VideoMetadata
impl UnsafeUnpin for VideoMetadata
impl UnwindSafe for VideoMetadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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