Pulsating Fade with FFmpeg

The goal of this walkthrough is to create a pulsating fade effect that can be continuously applied to an input stream where the duration is unknown, like a live source.

geq to the rescue

The geq filter allows the usage of an equation to be applied to each pixel. We can utilized this filter with the T variable which references the time of the current frame.

For our example, we will combine it with a simple sin to get a cyclic effect with a multiplier.

geq=a='abs(255*sin(T))'
  • a / alpha_exprcannot be set alone. Either lum or one of the r, g, b must be set along side. A hacky solution is to set rgb to its original value via r=r(X,Y)
  • abs is used here to simplify the sin‘s negative cycle
  • The layer must be converted to have a alpha channel so that the alpha channel can be changed

Results

Combining some knowledge from the previous post on Blur Out Videos with FFmpeg, we get the end result. This takes in 1 input source, generates the blurred version of it, then adjusts the alpha according to time, then overlays the results on the base.

30s of Big Buck Bunny

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store