You can concat videos by ffmpeg ## Install ``` npm i @secondphantom/ffmpeg-fast-concat ``` ## Usage ```ts const ffmpegFastConcat = new FfmpegFastConcat({ tempDir: 'tempDir', });
npm install @secondphantom/ffmpeg-fast-concat
npm i @secondphantom/ffmpeg-fast-concat
`
Usage
`ts
const ffmpegFastConcat = new FfmpegFastConcat({
tempDir: 'tempDir',
});const concatVideosDto: ConcatVideosDto = {
inputVideoPaths: ['input_1.mp4','input_2.mp4'],
outputVideoPath: 'output.mp4',
transition: {
duration: 500,
name: "fade",
},
};
const outputFilePath = await ffmpegFastConcat.concat.videos(concatVideosDto);
`
API
$3
#### constructor input
##### tempDir
- Type: string
- Required: truetempDir is
absolute path
##### concurrency
- Type: number
- Required: false
- Default: 4
$3
#### videos(input)
##### input
`ts
interface Transition {
name: string;
duration: number;
}type ConcatVideosDto = {
inputVideoPaths: string[];
outputVideoPath: string;
transition: Transition;
};
`
###### inputVideoPaths
- Type: Array
- Required: true
###### outputVideoPath
- Type: string
- Required: true
###### transition
###### transition.name
- Type: string
- Required: trueFFmpeg xfade
######
transition.duration
- Type: number`