automated converting between gif and mp4 with single image convertion separated
This commit is contained in:
14
extractFrames.js
Normal file
14
extractFrames.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const fs = require('fs');
|
||||
module.exports = async function extractFrames(inputFile = __dirname + '/input.mp4', outputFolder = __dirname + '/tmp-ss', callback) {
|
||||
console.log('extracting frames');
|
||||
fs.mkdirSync(outputFolder);
|
||||
|
||||
const extractFrames = require('ffmpeg-extract-frames')
|
||||
|
||||
await extractFrames({
|
||||
input: inputFile,
|
||||
output: outputFolder + '/%d.png',
|
||||
});
|
||||
|
||||
callback();
|
||||
}
|
||||
Reference in New Issue
Block a user