moviepy.video.tools.interpolators.Interpolator#

class moviepy.video.tools.interpolators.Interpolator(tt=None, ss=None, ttss=None, left=None, right=None)[source]#

Poorman's linear interpolator.

Parameters:
  • tt (list, optional) -- List of time frames for the interpolator.

  • ss (list, optional) -- List of values for the interpolator.

  • ttss (list, optional) -- Lists of time frames and their correspondients values for the interpolator. This argument can be used instead of tt and ss to instantiate the interpolator using an unique argument.

  • left (float, optional) -- Value to return when t < tt[0].

  • right (float, optional) -- Value to return when t > tt[-1].

Examples

# instantiate using `tt` and `ss`
interpolator = Interpolator(tt=[0, 1, 2], ss=[3, 4, 5])

# instantiate using `ttss`
interpolator = Interpolator(ttss=[[0, 3], [1, 4], [2, 5]])  # [t, value]