So I'm trying to use fluent-ffmpeg to concatenate (using concat demuxer) two .mp4 videos files (identical video/audio formats) but I'm getting this error:
Error: ffmpeg exited with code 1: ":../../input.txt": Invalid argument
Code to reproduce
const ffmpeg = require('fluent-ffmpeg');
.
.
const mergeVideoImageWithOriginalVideo = (imageVideo) => {
return new Promise((resolve, reject) => {
const command = new ffmpeg();
command
.input(`"../../${imageVideo.replace('./', '')}"`)
.inputFormat('concat')
.inputOptions(['-safe 0'])
.outputOptions(['-c copy'])
.on('start', function (ffmpegCommand) {
console.log(ffmpegCommand);
})
.on('progress', function (data) {
/// do stuff with progress data if you want
})
.on('end', function () {
resolve();
})
.on('error', function (error) {
return reject(new Error(error));
})
.save(`"../../${imageVideo.replace('txt', 'final.mp4').replace('./', '')}"`)
.run();
});
};
Version information
So I'm trying to use fluent-ffmpeg to concatenate (using concat demuxer) two .mp4 videos files (identical video/audio formats) but I'm getting this error:
Code to reproduce
The contents of input.txt:
The output of console.log(ffmpegCommand) is:
Expected results
Concatinate both video files into a video.fina.mp4
Observed results
The weird thing is when I run that exact command (using CMD) in the same directory that I'm running this nodejs script it works.