moviepy.video.fx.FreezeRegion#

class moviepy.video.fx.FreezeRegion.FreezeRegion(t: float = 0, region: tuple = None, outside_region: tuple = None, mask: Clip = None)[source]#

Freezes one region of the clip while the rest remains animated.

You can choose one of three methods by providing either region, outside_region, or mask.

Parameters:
  • t (float) -- Time at which to freeze the freezed region.

  • region (tuple) -- A tuple (x1, y1, x2, y2) defining the region of the screen (in pixels) which will be freezed. You can provide outside_region or mask instead.

  • outside_region (tuple) -- A tuple (x1, y1, x2, y2) defining the region of the screen (in pixels) which will be the only non-freezed region.

  • mask (moviepy.Clip.Clip) -- If not None, will overlay a freezed version of the clip on the current clip, with the provided mask. In other words, the "visible" pixels in the mask indicate the freezed region in the final picture.

apply(clip: Clip) Clip[source]#

Apply the effect to the clip.

copy()#

Return a shallow copy of an Effect.

You must always copy an Effect before applying, because some of them will modify their own attributes when applied. For example, setting a previously unset property by using target clip property.

If we was to use the original effect, calling the same effect multiple times could lead to different properties, and different results for equivalent clips.

By using copy, we ensure we can use the same effect object multiple times while maintaining the same behavior/result.

In a way, copy makes the effect himself being kind of idempotent.