I am looking to add the color filter to a rtmp stream in ffmpeg at specific time intervals, say for 10 seconds every 10 seconds. I have tried two approaches. The first:
-vf "color=#8EABB8@0.9:480x208,select='gte(t,10)*lte(t,20)' [color];[in][color] overlay [out]"
This streams only the 10 seconds indicated by the select and applies the color filter rather than playing the whole stream and applying the filter to just those 20 seconds.
I then learnt about split and fifo and tried this approach:
-vf "[in] split [no-color], fifo, [with-color] overlay [out]; [no-color] fifo, select='gte(t,10)*lte(t,20)' [with-color]"
I would expect this to play the entire stream, and then select the 10 seconds specified so that I can apply filters, but it does the same as first approach and just plays the 10 seconds selected rather than the entire stream.
Thanks in advance.
You changed the order of the streams going into the overlay.
It seems that if a "
select
"ed stream goes as first input to theoverlay
filter, overlay also blanks out its output in the non-selected times.But if you first provide a stable stream to
overlay
and then the selected, it will output a stream for the whole time.I tried following set of filters:
My version as graph:
Your version was (the select filter is the first
overlay
input!!):The reason is that
and
are equivalent.
But nevertheless there may remain some problems: Do you need the one time or every 10 seconds, e. g.?
As this question discusses, there doesn't appear to be a way to apply video filters to a specific time period of a video stream, short of splitting it into pieces, applying filters, and recombining. Please share if you find a better method.
I'm dealing with similar problem, I used combination of filter slpit, overlay and concat, and it works, you can try it.
but my problem is, I use gif as second input because it contains transparent color information, but gif file dosn't not contain audios. how can I make a movie with both transparent(or alpha) and audio?