我正在使用fluent-ffmpeg节点包来合并视频.我正在完全遵循文档,但我收到以下错误:Error: ffmpeg exited with code 1: Error configuring complex filters.
这是代码:
ffmpeg('/videos/test/part1.mov') .input('/videos/test/part2.mov') .on('error', function(err) { console.log('An error occurred: ' + err.message); }) .on('end', function() { console.log('Merging finished !'); }) .mergeToFile('videos/test/final.mp4', 'videos/test/tempDir');
这是错误输出(我将fluent-ffmpeg生成的命令记录到控制台):
C:\Program Files\ffmpeg\bin\ffmpeg.exe [ '-formats' ] { captureStdout: true } C:\Program Files\ffmpeg\bin\ffmpeg.exe [ '-encoders' ] { captureStdout: true } C:\Program Files\ffmpeg\bin\ffmpeg.exe [ '-i', '/videos/test/part1.mov', '-i','/videos/test/part2.mov', '-y', '-filter_complex', 'concat=n=2:v=1:a=1', 'videos/test/final.mp4' ] { niceness: 0 } An error occurred: Error: ffmpeg exited with code 1: Error configuring complex filters. Invalid argument at ChildProcess.(C:\test\node_modules\fluent-ffmpeg\lib\processor.js:169:22) at ChildProcess.emit (events.js:98:17) at Process.ChildProcess._handle.onexit (child_process.js:809:12)
我可以在我的机器上运行ffmpeg以执行其他任务,并且工作正常.我不确定'-filter_complex'标志应该做什么.我使用的是fluent-ffmpeg版本2.0.1和ffmpeg windows static build git-9d1fb9e(2015-12-17).