在fluent-ffmpeg中输出多个文件
问题描述:
是否可以将多个文件作为输入添加到fluent-ffmpeg并获取所有提供的文件的输出。在fluent-ffmpeg中输出多个文件
编辑1:
var commonPath = __dirname + '/path/to/file/';
ffmpeg()
.input(commonPath + 'file1.mp4')
.output(commonPath + 'newFile1.avi')
.toFormat('avi')
.input(commonPath + 'file2.mp4')
.output(commonPath + 'newFile2.avi')
.toFormat('avi')
.on('error',function(err){
console.log(err);
})
.run();
答
是的,如果你通过的fluent-ffmpeg
的文档,它指定那里,你可以使用.input()
和.output()
添加多个输入和输出。
感谢您的快速回复....我编辑了我的答案。我尝试了问题中提到的代码,但它将file2.mp4写入所有输出文件。你对这个问题有什么想法......? –