How to concat multiple MP4 files using fluent-ffmpeg?

I want to build a function to concat mp4 files using Firebase and fluent-ffmpeg.


・fluent-ffmpeg 2.1.2

・Firebase 7.6.0

However, an error will occur after startup.

  • The following is the error content.

Error: ffmpeg exited with code 1: Output with label '/tmp/public/thumbnail/source0000.jpg.mp4' does not exist in any defined filter graph, or was already used elsewhere.

  • Below is the actual code.
const from ={
   return path.join(os.tmpdir(), value);
   const chainedInputs = from.reduce((result, inputItem) => result.input(inputItem), ffmpeg());

   .on('start', function(commandLine) {
   console.log('Command line: ' + commandLine);
           filter: 'concat',
           options: {
               n: from.length,
               v: 1
   .outputOption('-strict -2')
   .on('error', function(err, stdout, stderr) {
       console.log('An error occurred: ' + err, stderr);
   .on('end', function() {
       console.log('Processing finished !');





Please can you tell me as to what I am missing?

Thank you.