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

Not working: TextClip positioning and SlideIn effect #2382

Open
Kinboise opened this issue Feb 24, 2025 · 0 comments
Open

Not working: TextClip positioning and SlideIn effect #2382

Kinboise opened this issue Feb 24, 2025 · 0 comments
Labels
bug Issues that report (apparent) bugs.

Comments

@Kinboise
Copy link

I'm trying to create a text overlay for my video. Positioning worked well for me in moviepy 1.x, but it always sticks at middle-left after I updated to 2.x. Tried .with_position(('left', 'top')), same result. Plus, SlideIn doesn't work for me while SlideOut does. Thanks!

import moviepy as mp

base = mp.ColorClip((1920, 1080), duration=5)

title = (
    mp.TextClip(
        './SmileySans-Oblique.otf',
        'lorem ipsum dolor sit amet',
        font_size=48,
        color='#fff',
        bg_color='#00000044',
        stroke_color='#000',
        stroke_width=2,
        margin=(40, 16, 8, 8),
        text_align='left',
        horizontal_align='left',
        vertical_align='top',
        duration=5,
    )
    .with_position((32, 32))
    .with_effects([mp.vfx.SlideIn(1, 'left'), mp.vfx.SlideOut(1, 'left')])
)

mp.CompositeVideoClip([base, title]).write_videofile('test.mp4', fps=24)

Expected Behavior

The title text ‘lorem ipsum dolor sit amet’ slides in to (32, 32) from top-left, stays there, and slides out.

Actual Behavior

The text appears at middle-left instead of top-left. It simply appears instead of sliding in. Slide out works, though.

Specifications

  • Python Version: 3.11.10
  • MoviePy Version: 2.1.2
  • Platform Name: Windows 11
  • Platform Version: 24H2
@Kinboise Kinboise added the bug Issues that report (apparent) bugs. label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that report (apparent) bugs.
Projects
None yet
Development

No branches or pull requests

1 participant