pub struct MediaMetadata {
pub video: Option<VideoMetadata>,
pub video_tracks: Option<Vec<VideoMetadata>>,
pub audio: Option<AudioMetadata>,
pub audio_tracks: Option<Vec<AudioMetadata>>,
pub subtitle: Option<SubtitleMetadata>,
pub subtitle_tracks: Option<Vec<SubtitleMetadata>>,
pub chapters: Option<Vec<ChapterMetadata>>,
pub duration: Duration,
pub format: String,
pub tags: Option<HashMap<String, String>>,
}Expand description
Complete metadata for a media file.
Contains optional video and audio stream metadata, plus container-level information such as total duration and format name.
§Example
use unbundle::{MediaFile, UnbundleError};
let unbundler = MediaFile::open("input.mp4").unwrap();
let metadata = unbundler.metadata();
println!("Duration: {:?}", metadata.duration);
println!("Format: {}", metadata.format);
if let Some(tracks) = metadata.audio_tracks.as_ref() {
println!("Audio tracks: {}", tracks.len());
}Fields§
§video: Option<VideoMetadata>Video stream metadata, if a video stream is present.
video_tracks: Option<Vec<VideoMetadata>>Metadata for all video tracks in the file.
None if there are no video streams. When present, the first entry
matches video (the “best” stream).
audio: Option<AudioMetadata>Audio stream metadata for the best (default) audio stream.
audio_tracks: Option<Vec<AudioMetadata>>Metadata for all audio tracks in the file.
None if there are no audio streams. When present, the first entry
matches audio (the “best” stream).
subtitle: Option<SubtitleMetadata>Subtitle stream metadata for the best subtitle stream.
subtitle_tracks: Option<Vec<SubtitleMetadata>>Metadata for all subtitle tracks in the file.
chapters: Option<Vec<ChapterMetadata>>Chapter metadata, if the container contains chapters.
Chapters represent named time segments (e.g. scenes, acts) embedded in
the container. None when no chapters are present.
duration: DurationTotal duration of the media file.
format: StringContainer format name (e.g. "mp4", "matroska", "avi").
Container-level metadata tags (e.g. title, artist, album, date).
None when the container has no metadata tags.
Trait Implementations§
Source§impl Clone for MediaMetadata
impl Clone for MediaMetadata
Source§fn clone(&self) -> MediaMetadata
fn clone(&self) -> MediaMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MediaMetadata
impl RefUnwindSafe for MediaMetadata
impl Send for MediaMetadata
impl Sync for MediaMetadata
impl Unpin for MediaMetadata
impl UnwindSafe for MediaMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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