Skip to content
Type

CmafOutputFormatOptions

CMAF-specific output options.

ts
type CmafOutputFormatOptions = Omit<IsobmffOutputFormatOptions, 'fastStart'> & {
	minimumFragmentDuration?: number;
};

See IsobmffOutputFormatOptions.

Used by

Properties

minimumFragmentDuration

ts
minimumFragmentDuration?: number;

Controls the minimum duration of each fragment, in seconds. New fragments will only be created when the current fragment is longer than this value. Defaults to Infinity, meaning the file will contain only one fragment.

metadataFormat

ts
metadataFormat?: 'auto' | 'mdir' | 'mdta' | 'udta';

The metadata format to use for writing metadata tags.

  • 'auto' (default): Behaves like 'mdir' for MP4 and like 'udta' for QuickTime, matching FFmpeg's default behavior.
  • 'mdir': Write tags into moov/udta/meta using the 'mdir' handler format.
  • 'mdta': Write tags into moov/udta/meta using the 'mdta' handler format, equivalent to FFmpeg's use_metadata_tags flag. This allows for custom keys of arbitrary length.
  • 'udta': Write tags directly into moov/udta.

Events

onFtyp

ts
onFtyp?: ((data: Uint8Array<ArrayBufferLike>, position: number) => unknown);

Will be called once the ftyp (File Type) box of the output file has been written.

onMoov

ts
onMoov?: ((data: Uint8Array<ArrayBufferLike>, position: number) => unknown);

Will be called once the moov (Movie) box of the output file has been written.

onMdat

ts
onMdat?: ((data: Uint8Array<ArrayBufferLike>, position: number) => unknown);

Will be called for each finalized mdat (Media Data) box of the output file. Usage of this callback is not recommended when not using fastStart: 'fragmented', as there will be one monolithic mdat box which might require large amounts of memory.

onMoof

ts
onMoof?: ((data: Uint8Array<ArrayBufferLike>, position: number, timestamp: number) => unknown);

Will be called for each finalized moof (Movie Fragment) box of the output file.

Released under the Mozilla Public License 2.0.