我的“filter_complex”设置有什么错误?

我的“filter_complex”设置有什么错误?

我是初学者。我有个问题想问。我用的是这个:

-filter_complex "[1:v][0:v]scale2ref[d][v1];[d][v1]overlay=enable='between(t,495.8,509)'[v2];[d][v2 ]overlay=enable='between(t,517.5,561.8)'[v3]" -map'[v3]'

我收到了这个错误信息:

错误消息:滤波器图描述中的流说明符 'd' [1:v][0:v]scale2ref[d][v1];[d][v1]overlay=enable='between(t,495.8,509)'[v2];[d][v2]overlay=enable='between(t,517.5,561.8)'[v3] 与任何流都不匹配。

为什么会发生这种情况?

答案1

不能使用 [d] 两次,请将其拆分后再重复使用:

ffmpeg -i "input 1.mp4" -i "test1.mkv" -filter_complex "
[1:v][0:v]scale2ref[1v][0v];
[1v]split[1v0][1v1];
[0v][1v0]overlay=enable='between(t,3,6)'[over1];
[over1][1v1]overlay=enable='between(t,9,12)'[over2]
" -map [over2] -y output.mp4

[编辑] if 5 拆分,感谢 llogan:

ffmpeg -i "input 1.mp4" -i "test01.mkv" -filter_complex "
[1:v][0:v]scale2ref[1v][0v];
[1v]split=5[1v1][1v2][1v3][1v4][1v5];
[0v][1v1]overlay=enable='between(t,2,4)'[over1];
[over1][1v2]overlay=enable='between(t,6,8)'[over2];
[over2][1v3]overlay=enable='between(t,10,12)'[over3];
[over3][1v4]overlay=enable='between(t,14,16)'[over4];
[over4][1v5]overlay=enable='between(t,18,20)'[over5]
" -map [over5] -y output.mp4

相关内容