问题描述
我正在尝试使用库 fluent-ffmpeg 连接音频和视频,但它不起作用。任何人都可以帮助我吗?
var proc = ffmpeg(firstFile)
.input(secondFile)
.input(thirdFile)
.input("./musicas/1.wav")
//.input(...)
.on('end',function() {
console.log('files have been merged succesfully');
})
.on('error',function(err) {
console.log('an error happened: ' + err.message);
})
.mergetoFile(outPath);
解决方法
在调用 mergeToFile
方法后使用事件。
var proc = ffmpeg(firstFile)
.input(secondFile)
.input(thirdFile)
.input("./musicas/1.wav")
.mergeToFile(outPath);
.on('end',function() {
console.log('files have been merged succesfully');
})
.on('error',function(err) {
console.log('an error happened: ' + err.message);
})