ffmpeg:多个filter_complex链,重新使用中间输出流 [英] ffmpeg: chain of multiple filter_complex, re-using intermediate output stream
问题描述
如何依次应用两个filter_complex命令?
How can I apply two filter_complex commands sequentially?
首先,我想将视频与图像融合 然后我要获取该过滤器的输出并将其分成4个图块,如这篇文章所述
first, I want to blend a video with an image then I want to take the output of that filter and split it into 4 tiles, as described in this post Stackoverflow.
我已经尝试过了: (我的策略是从filter_complex [int]生成中间输出,我想将该输出重复使用两次.
I have tried this: (my strategy was to generate an intermediate output from filter_complex [int] and I wanted to re-use that output twice.
ffmpeg.exe
-i videoIn.avi
-i imageIn.avi
-filter_complex "[1:0] setsar=sar=1 [1sared];[0:0][1sared]blend=all_mode='divide':repeatlast=1[int];
[int]crop=960:960:24:1055:[out1];
[int]crop=960:960:1056:1062:[out2]"
-map [out1] out1.avi
-map [out2] out2.avi
但是,我遇到一个错误: 过滤器描述中的流说明符'int'[int] crop = 960:960:24:1055 [out1]; [int] crop = 960:960:1056:1062:[out2]匹配任何流
however, I am getting an error: Stream specifier 'int' in filtergraph description [int]crop=960:960:24:1055[out1];[int]crop=960:960:1056:1062:[out2] matches no streams
如果我仅使用一个裁剪操作但不使用两个裁剪操作,则此代码有效-因此,我猜想中间流[int]无法以我尝试的方式重复使用?
this code works if I only use one crop operation but not with two - so I am guessing the intermediate stream [int] cannot be re-used the way I am trying to do it?
如何为后续过滤器多次重复使用中间流?
how can I re-use the intermediate stream multiple times for subsequent filters?
推荐答案
您必须使用 split 过滤器以复制输入流.
You have to use the split filter to duplicate the input stream.
示例:
[...] split [crop1][crop2];
[crop1] crop=960:960:24:1055 [out1];
[crop2] crop=960:960:1056:1062 [out2]
这篇关于ffmpeg:多个filter_complex链,重新使用中间输出流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!