我想构建一个使用Firebase和fluent-ffmpeg连接mp4文件的功能。
版本
・ fluent-ffmpeg 2.1.2
・ Firebase 7.6.0
但是,启动后将发生错误。
Error: ffmpeg exited with code 1: Output with label '/tmp/public/thumbnail/source0000.jpg.mp4' does not exist in any defined filter graph, or was already used elsewhere.
const from = concatFilePath.map(function(value){ return path.join(os.tmpdir(), value); }); const chainedInputs = from.reduce((result, inputItem) => result.input(inputItem), ffmpeg()); console.log('chainedInputs',chainedInputs); chainedInputs .on('start', function(commandLine) { console.log('Command line: ' + commandLine); }) .complexFilter([ { filter: 'concat', options: { n: from.length, v: 1 } } ],from ) .outputOption('-strict -2') .output(concatTmpThumbnailPath[0]) .on('error', function(err, stdout, stderr) { console.log('An error occurred: ' + err, stderr); }) .on('end', function() { console.log('Processing finished !'); }) .videoCodec('copy') .run();
concatFilePath
['public/video/source0000.mp4','public/video/source0001.mp4','public/video/source0002.mp4']
concatTmpThumbnailPath
['/tmp/public/concat/source0000.mp4','/tmp/public/concat/source0001.mp4','/tmp/public/concat/source0002.mp4']
请您告诉我我所缺少的东西吗?
谢谢。