I am currently using the npm package fluent-ffmpeg:
https://github.com/fluent-ffmpeg/node-fluent-ffmpeg
I would like to get this result:
But I do not know how to do that.
To be more precise I would like to resize and center the video and then add background image.
This is my current code (but it's not good):
const command = ffmpeg(video_path)
.size('640x480')
.autopad(true, 'pink')
.on('error', function(err) {
console.log('An error occurred: ' + err.message);
})
.on('end', function() {
console.log('Processing finished !');
const command2 = ffmpeg(destination_path1)
.size('1920x1080')
.applyAutoPadding(true, 'pink')
.on('error', function(err) {
console.log('An error occurred: ' + err.message);
})
.on('end', function() {
console.log('Processing finished !');
})
.save(destination_path2);
})
.save(destination_path1);
Can you help me?
Thank you so much