moviepy.video.fx.all.resize

moviepy.video.fx.all.resize(clip, newsize=None, height=None, width=None, apply_to_mask=True)[source]

Returns a video clip that is a resized version of the clip.

Parameters:
newsize:
Can be either
  • (width,height) in pixels or a float representing
  • A scaling factor, like 0.5
  • A function of time returning one of these.
width:

width of the new clip in pixel. The height is then computed so that the width/height ratio is conserved.

height:

height of the new clip in pixel. The width is then computed so that the width/height ratio is conserved.

Examples

>>> myClip.resize( (460,720) ) # New resolution: (460,720)
>>> myClip.resize(0.6) # width and heigth multiplied by 0.6
>>> myClip.resize(width=800) # height computed automatically.
>>> myClip.resize(lambda t : 1+0.02*t) # slow swelling of the clip