Skip to content
Type

ConversionOptions

The options for media file conversion.

ts
type ConversionOptions = {
	input: Input;
	output: Output;
	video?: ConversionVideoOptions
		| ((track: InputVideoTrack, n: number) => MaybePromise<ConversionVideoOptions | undefined>);
	audio?: ConversionAudioOptions
		| ((track: InputAudioTrack, n: number) => MaybePromise<ConversionAudioOptions | undefined>);
	trim?: {
		start: number;
		end: number;
	};
	tags?: (inputTags: MetadataTags) => MaybePromise<MetadataTags>;
};

See Input, Output, ConversionVideoOptions, InputVideoTrack, MaybePromise, ConversionAudioOptions, InputAudioTrack, and MetadataTags.

Used by

Properties

input

ts
input: Input;

The input file.

See Input.

output

ts
output: Output;

The output file.

See Output.

video

ts
video?: ConversionVideoOptions | ((track: InputVideoTrack, n: number) => MaybePromise<ConversionVideoOptions | undefined>);

See ConversionVideoOptions, InputVideoTrack, and MaybePromise.

audio

ts
audio?: ConversionAudioOptions | ((track: InputAudioTrack, n: number) => MaybePromise<ConversionAudioOptions | undefined>);

See ConversionAudioOptions, InputAudioTrack, and MaybePromise.

trim

ts
trim?: { start: number; end: number; };

Options to trim the input file.

tags

ts
tags?: ((inputTags: MetadataTags) => MaybePromise<MetadataTags>);

A callback that returns or resolves to the descriptive metadata tags that should be written to the output file. As input, this function will be passed the tags of the input file, allowing you to modify, augment or extend them.

If no function is set, the input's metadata tags will be copied to the output.

See MetadataTags and MaybePromise.

Released under the Mozilla Public License 2.0.