Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animate TextClip text value #199

Closed
maty974 opened this issue Aug 27, 2015 · 4 comments
Closed

Animate TextClip text value #199

maty974 opened this issue Aug 27, 2015 · 4 comments

Comments

@maty974
Copy link

maty974 commented Aug 27, 2015

Hi

I would like to animate the TextClip text parameter value at each frames, the text clip will be the
current frame value or a SMTPE timecode for example.

Is it possible to do it with MoviePy ?

Thanks a lot for your help.

@Zulko
Copy link
Owner

Zulko commented Aug 27, 2015

Hey,

TextClip is really for texts that don't move. Look here for an example where I use PIL/Pillow to generate the texts dynamically (it makes a "chronometer" clip which prints the timecode):

https://gist.github.com/Zulko/06f49f075fd00e99b4e6#file-moviepy_time_accuracy-py-L33-L39

@maty974
Copy link
Author

maty974 commented Aug 27, 2015

Cool I wil give it a try, but at the same time I've found this solution but I don't know if its safe to use TextClip like that

def make_frame(t):
    txt=TextClip("TEST %s" % t,color="#686868",fontsize=20,font="Arial")

    return txt.img

text_clip1=VideoClip(makeframe, duration=shot_clip.duration)

@Zulko
Copy link
Owner

Zulko commented Aug 27, 2015

I think it should be safe (no memory leak I think) but the solution I linked to is much faster.

@maty974
Copy link
Author

maty974 commented Aug 28, 2015

Alright thanks for your help Zulko ;)

@maty974 maty974 closed this as completed Aug 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants