Skip to main content

MatroskaReader

Struct MatroskaReader 

Source
pub struct MatroskaReader { /* private fields */ }
Expand description

Reads Matroska and WebM files: their tracks and each track’s packets, timed as FFmpeg’s Matroska demuxer and generic demuxing layer time them.

Timestamps are in the track’s time base, TimestampScale nanoseconds (milliseconds by default). Decode times FFmpeg leaves unset (the first packets of a reordered H.264, HEVC or MPEG-4 Part 2 stream) are the next packet’s decode time less the packet’s duration.

Implementations§

Source§

impl MatroskaReader

Source

pub fn open(path: &Path) -> Result<Self, DemuxError>

Opens the Matroska or WebM file at path.

§Errors

A file that cannot be read, is not Matroska, or breaks this layer’s limits.

Source

pub fn new<R: Read + Seek + Send + 'static>( source: R, ) -> Result<Self, DemuxError>

Reads a Matroska or WebM file from source.

§Errors

A source that cannot be read, is not Matroska, or breaks this layer’s limits.

Trait Implementations§

Source§

impl ContainerReader for MatroskaReader

Source§

fn tracks(&self) -> &[TrackInfo]

The tracks, in container order.
Source§

fn seek(&mut self, track: TrackId, pts: i64) -> Result<Option<i64>, DemuxError>

Positions track so its next packet is the latest keyframe whose presentation time is at or before pts, or its first packet when none is. Returns that keyframe’s pts; None for a track without packets. Read more
Source§

fn next_packet(&mut self, track: TrackId) -> Result<Option<Packet>, DemuxError>

The next packet of track in decode order; None at its end. Read more
Source§

fn default_video(&self) -> Option<usize>

The index into Self::tracks of the default video track: the first enabled video track flagged default, else the first video track.
Source§

fn default_audio(&self) -> Option<usize>

The index into Self::tracks of the default audio track, by the same rule.
Source§

impl Debug for MatroskaReader

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for MatroskaReader

§

impl !Sync for MatroskaReader

§

impl !UnwindSafe for MatroskaReader

§

impl Forget for MatroskaReader

§

impl Freeze for MatroskaReader
where *const dyn Source is !null: Freeze, PhantomData<dyn Source>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<TrackInfo>: Freeze, PhantomData<TrackState>: Freeze, *const LeafNode<u64, u64> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(u64, u64)>>: Freeze, PhantomData<(u64, u64)>: Freeze,

§

impl Move for MatroskaReader

§

impl Send for MatroskaReader
where BoxRaw<dyn Source>: Send, RawVecInner: Send, Bytes: Send, BoxRaw<VorbisModes>: Send, NodeRef<Owned, u64, u64, LeafOrInternal>: Send, BoxRaw<(u64, u64)>: Send,

§

impl Unpin for MatroskaReader
where Box<dyn Source>: Unpin, *const u8 is !null: Unpin, *const u8: Unpin, Align8<*mut ()>: Unpin, &'static Vtable: Unpin, Box<VorbisModes>: Unpin, *const LeafNode<u64, u64> is !null: Unpin, Box<(u64, u64)>: Unpin,

§

impl UnsafeUnpin for MatroskaReader

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.