Search code examples
ffmpeg

How to do filter twice at different time ffmpeg


Am trying to implement overlay twice but at different position and different time Here is what am trying to do: i just duplicate the filter

ffmpeg -t 50 -y -i film.mp4 -stream_loop -1 -i gif.gif -filter_complex "


[1]colorchannelmixer=aa=1,scale=iw*2:-1[a];[0][a]overlay=x='200':y='300':shortest=1:enable='between(t,0,10)';

[1]colorchannelmixer=aa=1,scale=iw*2:-1[b];[0][b]overlay=x='200':y='300':shortest=1:enable='between(t,15,20)'"  

-acodec copy output_task_3.mp4

But only the first overlay is been implemented, the seconds is not!

how to archive this?

Now i wrote a PHP script that dose this filter once each time, and repeat proccess then merge all videos, but this is taking so long.


Solution

  • No need to double filter. You can extend the enable expression.

    enable='between(t,0,10)+between(t,15,20)'