Skip to content

Function: compress() ​

ts
function compress(url, options?): Promise<CompressResult>;

Re-encode a video to make it smaller.

Parameters ​

ParameterTypeDescription
urlstringLocal path of the video.
optionsPartial<CompressOptions>Quality preset, or explicit bitrate, size and frame rate.

Returns ​

Promise<CompressResult>

The path of the compressed video, written to the cache directory.

Example ​

ts
const { outputPath } = await compress(videoUri, { quality: 'medium' });

Released under the MIT License.