automated converting between gif and mp4 with single image convertion separated

This commit is contained in:
2022-02-14 01:11:09 +02:00
parent 2395866988
commit f25b7868d7
12 changed files with 423 additions and 48 deletions

9
makeVideoFromImages.js Normal file
View File

@@ -0,0 +1,9 @@
const { exec } = require("child_process");
module.exports = function makeVideoFromImages(inputFilesPattern = './converted-ss/%d.png', outputFile = __dirname + '/output.mp4', originalFramerate = 10, outputFramerate = 10, callback) {
console.log('combining images to video');
exec(`ffmpeg -framerate ${originalFramerate} -i ${inputFilesPattern} -c:v libx264 -r ${outputFramerate} -pix_fmt yuv420p ${outputFile} -y`, () => {
callback(outputFile);
});
}