我真的很困惑如何在背景中附加图像并像前面那样运行视频
代码(此代码仅返回音频)
ffmpeg()
.input("front.mp4")
.input('./bg.jpg')
.complexFilter([
'overlay=(W-w)/2:(H-h)/2:shortest=1,format=yuv420p',
])
.output("output.mp4")
.on("error",function(er){
console.log("error occured: "+er.message);
})
.on('start', function() {
console.log('file starting');
})
.on('progress', function(progress) {
console.log('Processing: ' + progress.percent + '% done');
})
.on('codecData', function(data) {
console.log('Input is ' + data.audio + ' audio ' +
'with ' + data.video + ' video');
})
.on("end",function(){
console.log("success");
})
.run();