pub struct ContainerInfo { /* private fields */ }Expand description
Container-level metadata extracted from AVFormatContext.
Obtain an instance via VideoDecoder::container_info or
AudioDecoder::container_info from ff-decode.
§Examples
use ff_format::ContainerInfo;
let info = ContainerInfo::builder()
.format_name("mov,mp4,m4a,3gp,3g2,mj2")
.bit_rate(2_048_000)
.nb_streams(2)
.build();
assert_eq!(info.format_name(), "mov,mp4,m4a,3gp,3g2,mj2");
assert_eq!(info.bit_rate(), Some(2_048_000));
assert_eq!(info.nb_streams(), 2);Implementations§
Source§impl ContainerInfo
impl ContainerInfo
Sourcepub fn builder() -> ContainerInfoBuilder
pub fn builder() -> ContainerInfoBuilder
Returns a builder for constructing a ContainerInfo.
Sourcepub fn format_name(&self) -> &str
pub fn format_name(&self) -> &str
Short format name as reported by AVInputFormat::name
(e.g. "mov,mp4,m4a,3gp,3g2,mj2", "matroska,webm", "mp3").
Returns an empty string when the format context has no associated input format (e.g. raw streams or certain network sources).
Sourcepub fn bit_rate(&self) -> Option<u64>
pub fn bit_rate(&self) -> Option<u64>
Container-level bitrate in bits per second, or None when the
container does not report one (live streams, raw formats, etc.).
Sourcepub fn nb_streams(&self) -> u32
pub fn nb_streams(&self) -> u32
Total number of streams in the container (video + audio + subtitle + …).
Trait Implementations§
Source§impl Clone for ContainerInfo
impl Clone for ContainerInfo
Source§fn clone(&self) -> ContainerInfo
fn clone(&self) -> ContainerInfo
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 moreSource§impl Debug for ContainerInfo
impl Debug for ContainerInfo
Source§impl PartialEq for ContainerInfo
impl PartialEq for ContainerInfo
impl Eq for ContainerInfo
impl StructuralPartialEq for ContainerInfo
Auto Trait Implementations§
impl Freeze for ContainerInfo
impl RefUnwindSafe for ContainerInfo
impl Send for ContainerInfo
impl Sync for ContainerInfo
impl Unpin for ContainerInfo
impl UnsafeUnpin for ContainerInfo
impl UnwindSafe for ContainerInfo
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