我试图合并两个视频,但我需要两个视频的高度和宽度相同。每个视频A都有不同的高度和宽度,我想制作一个脚本,将视频B转换为视频A的相同帧宽和宽度。
我正在使用fluent-ffmpeg库。 我试过了:
require('fluent-ffmpeg')
var video_A_width = getWidth(pathA);
var video_A_height = getHeight(pathA);
var proc = ffmpeg('B.mp4').size(video_A_width+'x'+video_A_height)
proc.setFfmpegPath(mypath);
proc
.input('A.mp4')
.on('end', function() {
console.log('files have been merged succesfully');
})
.on('error', function(err) {
console.log('an error happened: ' + err.message);
})
.mergeToFile("newvideo.mp4");
Output: ffmpeg exited with code 1: Filtergraph scale=w=1280:h=720' was specified through the -vf/-af/-filter option for output stream ):), which is fed from a complex filtergraph
我该怎么做?