ConversionVideoOptions
Video-specific options.
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
discard?: boolean;
If true
, all video tracks will be discarded and will not be present in the output.
width
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
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
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
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
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
codec?: VideoCodec;
The desired output video codec.
See VideoCodec
.
bitrate
bitrate?: number | Quality;
The desired bitrate of the output video.
See Quality
.
forceTranscode
forceTranscode?: boolean;
When true
, video will always be re-encoded instead of directly copying over the encoded samples.