Skip to content
Type

ConversionVideoOptions

Video-specific options.

ts
type ConversionVideoOptions = {
	discard?: boolean;
	width?: number;
	height?: number;
	fit?: 'fill' | 'contain' | 'cover';
	rotate?: Rotation;
	frameRate?: number;
	codec?: VideoCodec;
	bitrate?: number | Quality;
	forceTranscode?: boolean;
};

See Rotation, VideoCodec, and Quality.

Used by

Properties

discard

ts
discard?: boolean;

If true, all video tracks will be discarded and will not be present in the output.

width

ts
width?: number;

The desired width of the output video in pixels, defaulting to the video's natural display width. If height is not set, it will be deduced automatically based on aspect ratio.

height

ts
height?: number;

The desired height of the output video in pixels, defaulting to the video's natural display height. If width is not set, it will be deduced automatically based on aspect ratio.

fit

ts
fit?: 'fill' | 'contain' | 'cover';

The fitting algorithm in case both width and height are set, or if the input video changes its size over time.

  • 'fill' will stretch the image to fill the entire box, potentially altering aspect ratio.
  • 'contain' will contain the entire image within the box while preserving aspect ratio. This may lead to letterboxing.
  • 'cover' will scale the image until the entire box is filled, while preserving aspect ratio.

rotate

ts
rotate?: Rotation;

The angle in degrees to rotate the input video by, clockwise. Rotation is applied before resizing. This rotation is in addition to the natural rotation of the input video as specified in input file's metadata.

See Rotation.

frameRate

ts
frameRate?: number;

The desired frame rate of the output video, in hertz. If not specified, the original input frame rate will be used (which may be variable).

codec

ts
codec?: VideoCodec;

The desired output video codec.

See VideoCodec.

bitrate

ts
bitrate?: number | Quality;

The desired bitrate of the output video.

See Quality.

forceTranscode

ts
forceTranscode?: boolean;

When true, video will always be re-encoded instead of directly copying over the encoded samples.

Released under the Mozilla Public License 2.0.