[Python] Moviepy zooming effects need tweaking

Discussão em 'Python' iniciado por Stack, Julho 27, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to zoom a clip to a certain dimension, then stop further zooming. In other words, the clip stop further increasing its size after reaching a certain size, and its better if the clip start zooming from much smaller of its original size, and to a bigger version. I am using moviepy module. With the following code I can progressively zoom a clip, but having a hard time figuring out how to grow a clip from small to big, creating an animated effect. Any feedback you provide is greatly appreciated.

    import os
    from moviepy.editor import *

    screensize = (640,360)

    clip = (ImageClip(img)
    .resize(height=screensize[1]*4)
    .resize(lambda t : 1+0.02*t)
    .set_position(('center', 'center'))
    .set_duration(10)
    )


    I am having a very hard time figuring out how to write a function in order to create a type-writing effect with moviepy's txtclip, meaning letters within the clip will be shown one after another, creating a smooth type-writer animation text. Moviepy got some helpful classes such as findObjects--which can detect individual letters out of a clip:

    txtClip = TextClip('Cool effect',color='white', font="Amiri-Bold",
    kerning = 5, fontsize=100)
    cvc = CompositeVideoClip( [txtClip.set_pos('center')],
    size=screensize, transparent=True)

    letters = findObjects(cvc) # a list of ImageClips

    here is the link: http://zulko.github.io/moviepy/examples/moving_letters.html


    after finding the letters(letter clips) I would like to join them in such a way that they appear one after another, which looks like type writing.

    The documentation already got a few examples of moving letters, which might be of great use, however. Thank you

    Continue reading...

Compartilhe esta Página