Reputation: 163
I have an ffmpeg command that looks like this:-
'-filter_complex', "[0:v][1:v]overlay=89:13:enable='between(t,0,2)'[out1];[out1]crop=200:200:89:13[cropped1];[cropped1][2:v]blend=difference[out2];[out1][out2]overlay=89:13:enable='between(t,0,2)'[out2];[out2]colorspace=all=bt709:iall=bt601-6-625:fast=1"
and I receive this error message:-
[matroska,webm @ 0x6e67cc0] Invalid stream specifier: out1
Last message repeated 1 times
I wonder what I need to do so that the message works fine and the video renders ? Any suggestion would be much appreciated.
In the command above we overlay the 2nd asset over the 1st, and we select the output of that to be the variable out1.
We then take a crop of out1 and call that result cropped1.
We then blend the 3rd asset over the cropped1 as these are now both the same size, we call that blended result out2.
We then overlay out2 over out1, and (i'm hoping) overwrite out2 as the new output with the blend overlaid over out 1.
We then pass out2 through a colour mapping.
Which then is not assigned an output so can be picked up when written to video output..
Upvotes: 1
Views: 1562
Reputation: 5543
you cannot reuse filter pads. So, must use split
/asplit
filters to duplicate the internal streams. As such, the issue with [out1]
is simple, just insert split
filter and feed its outputs to the next filters.
[out2]
is also reused and that's a bit tricky. I think one approach is to use another overlay
filter. So, something like this:
[0:v][1:v]overlay=89:13:enable='between(t,0,2)',split[out1a][out1b]; \
[out1a]crop=200:200:89:13[cropped1]; \
[cropped1][2:v]blend=difference,split[out2a][out2b]; \
[out1b][out2a]overlay=89:13:enable='between(t,0,2)'[out3]; \
[out2b][out3]overlay=enable='between(t,0,2)',\
colorspace=all=bt709:iall=bt601-6-625:fast=1
overlay
filter when disabled passes the base stream IIRC, so [out1b][out2a]overlay
does not show [out2a]
stream by default. Adding the 3rd overlay
filter shows the correct stream when disabled.
Not tested, but something that you can perhaps build on.
Upvotes: 3