Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 68 variants InvalidAspect(&'static str), InvalidSubtitle(&'static str), Mp4(Arc<dyn Error + Send + Sync>), Moq(Error), Flac(Error), Opus(Error), MissingKeyframe(MissingKeyframe), InvalidEnd(InvalidEnd), TimestampRewind(TimestampRewind), TimestampOverflow(TimeOverflow), NoTraf, NoTfdt, PtsOverflow, NoMoof, NoMdat, NoMoov, NoTracks, MultipleTracks, UnsupportedSynthesis(String), UnsupportedSubtitle, UnknownTrackHandler([u8; 4]), MissingCodec, MultipleCodecs, UnknownCodec(String), InvalidColr(u16), UnsupportedSpatial(&'static str), UnsupportedCodec(String), UnsupportedMpeg2, MissingDecoderSpecific, DuplicateMoof, DuplicateMoov, MissingTrun, MissingTfdt, MissingVideoDescription(String), MissingVideoDimensions(String), InvalidDataOffset, BackwardsDataOffset, MetadataTooLarge { kind: String, size: usize, }, TextSampleTooLarge(usize), TooManySamples(u64), TooManyTracks(usize), UnsupportedBaseDataOffset, EmptySample, TimescaleMismatch { track: Option<Timescale>, mdhd: Timescale, }, UnknownTrack(u32), NoKeyframe, SampleRangeOutOfBounds { start: usize, end: usize, len: usize, }, NoFrames, MissingAudioDescription(String), OpusChannelCount { catalog: u32, head: u32, }, InvalidAudioConfig { sample_rate: u32, channel_count: u32, }, MissingSampleDuration, TimescaleTooLarge(u64), TimescaleOverride, SampleDurationTooLarge(u64), SampleDurationTooSmall(u64), SampleDurationInexact(u64), MissingVideoDuration, NonMonotonicDecodeTime { track: u32, decode_time: Timestamp, previous: Timestamp, }, TrackAdded(String), TrackChanged(String), TrackRewound { track: String, start: Duration, written: Duration, }, TrackUndescribed(Vec<String>), UnsupportedEditList(&'static str), Unindexable { track: u32, reason: &'static str, }, TooManyChapters(usize), ChapterTitleTooLong(usize), Unrepairable(&'static str),
}
Expand description

Fragmented MP4 parsing, muxing, and transport errors.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

InvalidAspect(&'static str)

Container display metadata has no valid catalog aspect ratio.

§

InvalidSubtitle(&'static str)

A subtitle sample cannot be reconstructed with valid text and timing.

§

Mp4(Arc<dyn Error + Send + Sync>)

Parsing or encoding an MP4 atom failed.

§

Moq(Error)

A MoQ transport operation failed.

§

Flac(Error)

Parsing the FLAC configuration failed.

§

Opus(Error)

Parsing or encoding the Opus configuration failed.

§

MissingKeyframe(MissingKeyframe)

A group was opened without a keyframe.

§

InvalidEnd(InvalidEnd)

An explicit video endpoint precedes its last frame.

§

TimestampRewind(TimestampRewind)

A frame’s timestamp sits below the live edge earlier groups reached.

§

TimestampOverflow(TimeOverflow)

A timestamp calculation overflowed.

§

NoTraf

The fragment has no traf box.

§

NoTfdt

The track fragment has no tfdt box.

§

PtsOverflow

The presentation timestamp calculation overflowed.

§

NoMoof

The fragment has no moof box.

§

NoMdat

The fragment has no mdat box.

§

NoMoov

The initialization segment has no moov box.

§

NoTracks

The moov box has no tracks.

§

MultipleTracks

The moov box has multiple tracks where only one is supported.

§

UnsupportedSynthesis(String)

The named codec cannot supply a synthesized CMAF initialization segment.

§

UnsupportedSubtitle

The track handler declares unsupported subtitle media.

§

UnknownTrackHandler([u8; 4])

The track handler has an unrecognized four-character code.

§

MissingCodec

The sample description has no codec entry.

§

MultipleCodecs

The sample description has multiple codec entries.

§

UnknownCodec(String)

The sample entry has an unrecognized codec, named by its four-character code.

§

InvalidColr(u16)

A colr box code point past H.273’s 255.

§

UnsupportedSpatial(&'static str)

A Spherical Video V2 sv3d or st3d box the catalog cannot describe, or a malformed one.

§

UnsupportedCodec(String)

The sample entry declares a codec moq-mux does not carry, named by its four-character code.

§

UnsupportedMpeg2

The sample entry declares unsupported MPEG-2 media.

§

MissingDecoderSpecific

An AAC sample entry needs DecoderSpecificInfo to identify its codec profile.

§

DuplicateMoof

A second moof box arrived before the preceding fragment was complete.

§

DuplicateMoov

A second moov would re-declare the track set the first one already declared.

§

MissingTrun

The track fragment has no trun box.

§

MissingTfdt

The track fragment has no decode-time box.

§

MissingVideoDescription(String)

The named video codec lacks the configuration needed to synthesize a CMAF init.

§

MissingVideoDimensions(String)

A synthesized video track has no usable encoded dimensions.

§

InvalidDataOffset

The fragment data offset cannot address its sample data.

§

BackwardsDataOffset

Streaming import requires each track’s sample bytes in decode order.

§

MetadataTooLarge

A metadata body over 2 MiB is refused before parsing.

Fields

§kind: String

The box type’s four-character code.

§size: usize

The body size its header declares.

§

TextSampleTooLarge(usize)

A text sample is rewritten whole, so one larger than moq-net’s 32 MiB frame bound is refused before any of its bytes are staged.

§

TooManySamples(u64)

A fragment declaring more than 131,072 samples, or more than one sample per byte of its metadata past a small base, is refused before parsing. A trun without per-sample fields declares its count in four bytes, so the byte bound alone does not limit it.

§

TooManyTracks(usize)

A moov declaring more than 256 tracks is refused before any is created.

§

UnsupportedBaseDataOffset

Absolute file offsets cannot be resolved in a standalone fragment.

§

EmptySample

Every media sample must contain at least one byte.

§

TimescaleMismatch

The frame timestamp carries a fragment’s earliest presentation time exactly only when the track counts in the same ticks as the media.

Fields

§track: Option<Timescale>

The timescale declared by the MoQ track, if any.

§mdhd: Timescale

The media timescale declared by the mdhd box.

§

UnknownTrack(u32)

The fragment references an undeclared track ID.

§

NoKeyframe

The first sample in the group is not a keyframe.

§

SampleRangeOutOfBounds

The sample byte range extends outside the mdat payload.

Fields

§start: usize

The first sample byte offset in the mdat payload.

§end: usize

The exclusive end offset in the mdat payload.

§len: usize

The mdat payload length in bytes.

§

NoFrames

Fragment encoding was requested with no frames.

§

MissingAudioDescription(String)

The named audio codec lacks the configuration needed to synthesize a CMAF init.

§

OpusChannelCount

An Opus catalog entry whose OpusHead contradicts its channel count.

Fields

§catalog: u32

The channel count declared by the catalog.

§head: u32

The channel count declared by the OpusHead.

§

InvalidAudioConfig

An audio config whose sample rate or channel count is zero, or whose channel count does not fit a sample entry’s 16-bit field.

Fields

§sample_rate: u32

The catalog sample rate.

§channel_count: u32

The catalog channel count.

§

MissingSampleDuration

A non-final sample has no duration, so its decode timeline cannot be recovered.

§

TimescaleTooLarge(u64)

mdhd.timescale is a 32-bit field, so a larger scale would reach the init segment truncated while the fragments kept the full value, putting them on different timelines.

§

TimescaleOverride

A Cmaf rendition’s init passes through from the catalog at its own scale, so Muxer::with_timescale can’t move it without desynchronising it from the fragments.

§

SampleDurationTooLarge(u64)

A sample duration is a 32-bit trun field. A larger value would wrap in the media while the fragment metadata kept the full duration, putting them on different timelines.

§

SampleDurationTooSmall(u64)

A positive sample duration must occupy at least one tick in the output timescale.

§

SampleDurationInexact(u64)

Repeatedly flooring fractional sample ticks would make the decode timeline drift.

§

MissingVideoDuration

Presentation timestamps do not reveal decode duration for reordered video.

§

NonMonotonicDecodeTime

Each fragment restates its decode time, so a stale one lands two different samples on the same timestamp. ffmpeg writes one when frag_every_frame interleaves audio and video; -frag_duration cuts just as finely and stamps the fragments correctly.

Fields

§track: u32

The track containing the rejected fragment.

§decode_time: Timestamp

The rejected fragment’s decode time in the track’s timescale.

§previous: Timestamp

The preceding fragment’s decode time in the track’s timescale.

§

TrackAdded(String)

The init segment fixes the track set, so a rendition that joins later can’t be written, unless it continues a declared track of its medium that failed.

§

TrackChanged(String)

A rendition’s sample entry no longer matches the one the init segment declared.

§

TrackRewound

A rendition restarted at or before media already written for it, such as a resubscription replaying cached groups.

Fields

§track: String

The rendition name.

§start: Duration

The rejected fragment’s presentation time.

§written: Duration

The latest presentation time already written for the rendition.

§

TrackUndescribed(Vec<String>)

The init segment waited too long, or the broadcast ended, before these renditions delivered the codec configuration their track needs.

§

UnsupportedEditList(&'static str)

A track’s edit list does more than delay the track and start its media at one time.

§

Unindexable

A fragment written to a regular MP4 can’t be indexed in its final moov.

Fields

§track: u32

The fragment’s track id.

§reason: &'static str

What the sample tables can’t express.

§

TooManyChapters(usize)

A regular MP4’s chapter list holds 255 chapters.

§

ChapterTitleTooLong(usize)

A regular MP4’s chapter list holds titles of 255 bytes.

§

Unrepairable(&'static str)

A file to repair is not a recording that an MP4 export left unfinished.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidEnd> for Error

Source§

fn from(source: InvalidEnd) -> Self

Converts to this type from the input type.
Source§

impl From<MissingKeyframe> for Error

Source§

fn from(source: MissingKeyframe) -> Self

Converts to this type from the input type.
Source§

impl From<TimeOverflow> for Error

Source§

fn from(source: TimeOverflow) -> Self

Converts to this type from the input type.
Source§

impl From<TimestampRewind> for Error

Source§

fn from(source: TimestampRewind) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more