automated converting between gif and mp4 with single image convertion separated
This commit is contained in:
9
addAudio.js
Normal file
9
addAudio.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const { exec } = require("child_process");
|
||||
|
||||
module.exports = function addAudio(inputVideoFile = __dirname + '/input.mp4', inputAudioFile = __dirname + '/input.mp3', outputFile = __dirname + '/output.mp4', callback) {
|
||||
console.log('adding audio to video file');
|
||||
exec(`ffmpeg -i ${inputVideoFile} -i ${inputAudioFile} -c:v copy -c:a aac ${outputFile} -y`, () => {
|
||||
callback(outputFile);
|
||||
});
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user