0.1.3 • Published 4 months ago
@secondphantom/ffmpeg-fast-concat v0.1.3
Ffmpeg Fast Concat
You can concat videos by ffmpeg
Install
npm i @secondphantom/ffmpeg-fast-concat
Usage
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
Constructor
constructor input
tempDir
- Type:
string
- Required: true
tempDir is absolute path
concurrency
- Type:
number
- Required: false
- Default: 4
concat
videos(input)
input
interface Transition {
name: string;
duration: number;
}
type ConcatVideosDto = {
inputVideoPaths: string[];
outputVideoPath: string;
transition: Transition;
};
inputVideoPaths
- Type:
Array<string>
- Required: true
outputVideoPath
- Type:
string
- Required: true
transition
transition.name
- Type:
string
- Required: true
transition.duration
- Type:
number
- Required: true
return
output file path