FFMPEG fade in/out expressions

I've been playing with FFMPEG lately mulling over a plugin for Appcelerator Titanium and figured we'll need a text rendering with nice fading in/out effect. There's text drawing filter in FFMPEG, but not a function to easily fade it, so I came up with a couple of expressions of my own. I'm working with alpha channel here, but it can easily be applied to other properties.

Fading in


  • t1 - start time (in seconds),
  • t2 - length (in seconds).

Fading out


  • t1 - start time (in seconds),
  • t2 - length (in seconds).

Fading in and out


  • t1 - fade in start time (in seconds),
  • t2 - fade in length (in seconds),
  • t3 - time to keep fully opaque (in seconds),
  • t4 - fade out length (in seconds).

If you happen to know a better way or shorter expressions, please let me know.

comments powered by Disqus