我正在使用fluent-ffmpeg
Node.js库对视频文件进行批量处理。视频过滤器可以裁剪16:9的输入,添加填充并将字幕烧入到填充中。
在下一步中,我想使用复杂的过滤器将图像作为水印叠加在视频上。
ff.input(video.mp4)
ff.input(watermark.png)
ff.videoFilter([
'crop=in_w-2*150:in_h',
'pad=980:980:x=0:y=0:color=black',
'subtitles=subtitles.ass'
])
ff.complexFilter([
'overlay=0:0'
])
ff.output(output.mp4)
然而,运行此代码时,会出现以下错误:
Filtergraph 'crop=in_w-2*150:in_h,pad=980:980:x=0:y=0:color=black,subtitles=subtitles.ass' was specified through the -vf/-af/-filter option for output stream 0:0, which is fed from a comple.
-vf/-af/-filter and -filter_complex cannot be used together for the same stream.
据我所了解,视频过滤器和复杂过滤器选项不能同时使用。如何解决这个问题?