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?
Make sure that the
dateStr
variable does not have a "/" (forward slash), as it is not possible to save files with this character.Wrong:
Right:
Let me know if you solved it.