Skip to content

Function: merge() ​

ts
function merge(urls, options?): Promise<MergeResult>;

Concatenate several clips into one file, in order. Clips may differ in resolution, frame rate and codec; they are converted to match the first clip. Only local files are supported.

Parameters ​

ParameterTypeDescription
urlsstring[]Local paths of the clips, in playback order.
optionsPartial<MergeOptions>Output options.

Returns ​

Promise<MergeResult>

The path and duration of the merged file, written to the cache directory.

Throws ​

Error synchronously when urls is empty.

Example ​

ts
const { outputPath } = await merge([clip1, clip2, clip3]);

Released under the MIT License.