0

Im triyng to concat audio and video with the library fluent-ffmpeg but it is not workyng. Anyone can help me?

var proc = ffmpeg(firstFile)
    .input(secondFile)
    .input(thirdFile)
    .input("./musicas/1.wav")
    //.input(...)
    .on('end', function() {
      console.log('files have been merged succesfully');
    })
    .on('error', function(err) {
      console.log('an error happened: ' + err.message);
    })
    .mergeToFile(outPath);
  • Does this answer your question? [Merge Multiple Videos using node fluent ffmpeg](https://stackoverflow.com/questions/28877848/merge-multiple-videos-using-node-fluent-ffmpeg) – Charlie Mar 26 '21 at 17:15
  • I can merge two video, but I want to add audio to the video merged and it is not working – Texugo Raivoso Mar 26 '21 at 17:46

1 Answers1

0

Use the events after the mergeToFile method is called.

var proc = ffmpeg(firstFile)
    .input(secondFile)
    .input(thirdFile)
    .input("./musicas/1.wav")
    .mergeToFile(outPath);
    .on('end', function() {
      console.log('files have been merged succesfully');
    })
    .on('error', function(err) {
      console.log('an error happened: ' + err.message);
    })
Charlie
  • 22,886
  • 11
  • 59
  • 90
  • 2
    Cannot find a matching stream for unlabeled input pad 3 on filter Parsed_concat_0 this not work.. I am also getting the same error – Texugo Raivoso Mar 26 '21 at 17:48