Skip to content

Loop + custom end time is not working? #10

Description

@francozanardi

Context

This issue is extracted from this comment.


What I want

  • I have a 30-second subscribe video
  • I’m adding it on top of another video
  • I want only the first 15 seconds of the subscribe video to play
  • That 15-second segment should loop repeatedly for the full duration of the main video

What’s happening now

  • Instead of looping just the first 15 seconds,
  • the entire 30-second subscribe video is looping

So the loop ignores the 15-second limit and keeps replaying the full clip.

Check below example

import movielite as mvl

video_end_time = 60
video_width, video_height = video_sizes["4k"]
bg_clip = mvl.ImageClip.from_color(color=hex2rgb("#dbeff4"), size=(video_width,video_height), start=0)
subscribe_clip = mvl.AlphaVideoClip("Subscribe Button.mov", start=0).subclip(0, 15)
subscribe_clip.loop(True)
subscribe_clip.set_end(60)
bg_clip.set_end(video_end_time)
writer = mvl.VideoWriter(f"{"test"}.mp4", fps=30, size=(video_width, video_height), duration=video_end_time)
writer.add_clips([bg_clip, subscribe_clip])
writer.write()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions