Skip to main content

FragmentedOptions

Struct FragmentedOptions 

Source
pub struct FragmentedOptions {
    pub cadence: FragmentCadence,
    pub styp: Option<BrandPreset>,
    pub emit_random_access_indexes: bool,
}
Expand description

Fragmented-MP4 muxer options.

When Mp4MuxerOptions::fragmented is Some(FragmentedOptions { .. }), the muxer writes the file as

ftyp
moov                    (mvex+trex; no media samples in moov)
sidx?                   (one per fragment, references the next moof+mdat)
styp? + moof + mdat     (per fragment, repeated)
sidx? + styp? + moof + mdat
...
mfra?                   (at end: per-track tfra + mfro size trailer)

matching ISO/IEC 14496-12 §8.8 (Movie Fragments) + §8.16 (sidx) + §8.8.10 (mfra) + DASH-IF Interop guidelines for styp brands.

Fields§

§cadence: FragmentCadence

When to flush a fragment; see FragmentCadence.

§styp: Option<BrandPreset>

Emit a styp SegmentTypeBox before each moof+mdat pair (CMAF segment marker). When None, no styp is written and the file is a plain fragmented ISOBMFF (still valid for any DASH parser, but not a CMAF-conformant addressable segment).

DASH-IF Interop §6.2 recommends styp(major=msdh, compat=msdh msix) for an indexed media segment, or cmfs / cmff for CMAF brand signalling. The default Some(BrandPreset::Custom { major: msdh, compatible: [msdh, msix] }) is the broadly-interop choice.

§emit_random_access_indexes: bool

Emit sidx (SegmentIndexBox §8.16.3) before each moof+mdat and an mfra (MovieFragmentRandomAccessBox §8.8.10) trailer with per-track tfra random-access tables + the size-of-mfra mfro at end of file. Required for the DASH on-demand profile (single file with embedded byte-range index) and for fast random-access without scanning every moof. Default true.

The emitted sidx is a single-entry index covering the immediately- following moof+mdat (the simplest legal form per §8.16.3); a multi-segment top-level sidx can be layered on by an outer segmenter if needed.

Trait Implementations§

Source§

impl Clone for FragmentedOptions

Source§

fn clone(&self) -> FragmentedOptions

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 FragmentedOptions

Source§

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

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

impl Default for FragmentedOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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, 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> Same for T

Source§

type Output = T

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.