Function: compress()
ts
function compress(url, options?): Promise<CompressResult>;Re-encode a video to make it smaller.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | Local path of the video. |
options | Partial<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' });