#[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
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
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
mdhd: TimescaleThe 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
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
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.
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
decode_time: TimestampThe rejected fragment’s decode time in the track’s timescale.
previous: TimestampThe 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
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
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 Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()