0

This answer was very usefull for me to learn how to include texts in a video using ffmepg. Now at one position of the video I want to always show a text but it changes. So what I did is for one text I used for example enable='between(t,0,5)' and for the next enable='between(t,5,10)'. Now at the frame at 5 seconds the video shows both texts. That is not what I want. I guess the reason is that enable='between(t,0,5)' includes the boundaries of the interval. So I somehow need ffmpeg to stop showing the first text one frame earlier. How do I do that?

principal-ideal-domain
  • 3,998
  • 8
  • 36
  • 73

1 Answers1

1

Use the "t>=t0 AND t<t1" logic":

enable='gte(t,0)*gt(t,5)'
enable='gte(t,5)*gt(t,10)'

Alternately, if your video is cfr (constant frame rate), then use frame index instead. For example, if fps=30, t=5 -> n=150 and t=10 -> n=300. Accordingly,

enable='between(n,0,149)'
enable='between(n,150,300)'

Finally, you can do a hack-job:

enable='between(t,0,4.999)'

You can read up more on FFmpeg expressions in the documentation

kesh
  • 4,515
  • 2
  • 12
  • 20