The command below blends input2
into input1
using a binary of *if
expressions featuring the between
statement's t
variable. As such, output
= input1
, but with input2
at 00:00:03- 00:00:05
:
ffmpeg -y -i input1.mkv -i input2.mkv -filter_complex "[1:v][0:v]scale2ref[v1][v0];[v0][v1]blend=all_expr='A*if(between(T, 3, 5), 0, 1)+B*if(between(T, 3, 5), 1, 0)'" -vcodec libx264 -pix_fmt yuv444p -crf 18 -acodec copy output.mkv
My question is how these can be chained together in the case of a set of evaluated conditions. I've attempted the +
operator, below, but input1
is no longer the same. It seems distorted by multiple layers of the video.
ffmpeg -y -i input1.mkv -i input2.mkv -filter_complex "[1:v][0:v]scale2ref[v1][v0];[v0][v1]blend=all_expr='A*if(between(T, 3, 5), 0, 1)+B*if(between(T, 3, 5), 1, 0)'+'A*if(between(T, 7, 9), 0, 1)+B*if(between(T, 7, 9), 1, 0)'" -vcodec libx264 -pix_fmt yuv444p -crf 18 -acodec copy output.mkv
How can these be chained together without producing visual artifacts?
This question is a follow-up to Rotem's solution to my earlier question.