Ffmpeg-fluent throwing "At least one output file must be specified" error

475 views Asked by At

Code:

inputs: The directory is my directory. Username is a string, for example "james". fileExtentionsion is the video extension, for example .mp4. dateStr is a date string. Compression is just the factor, ie 40.

ffmpeg()
      .input(`${directory}${username}/video${fileExtension}`)
      .save(`${directory}${username}/${dateStr}${fileExtension}`)
      .addOptions(`-c:v libx265 -crf ${compression} -preset veryfast -c:a aac -b:a 128k`)
      .on("start", (commandLine) => {
        console.log("start : " + commandLine);
      })
      .on("progress", (progress) => {
        console.log("In Progress !!" + Date());
      })
      .on("end", () => resolve())
      .on("error", (err) => {
        console.log("reject");
        return reject(err);
      });
  });

Does anyone know why this does not run, even though it runs in the command line?

1

There are 1 answers

1
Josias da Paixao junior On

Make sure that the dateStr variable does not have a "/" (forward slash), as it is not possible to save files with this character.

Wrong:

let dateStr = "10/26/2020"

Right:

let dateStr = "26-10-2020"

Let me know if you solved it.