mirror of
https://github.com/chev2/shitpost-video-generator.git
synced 2026-04-27 05:01:45 +00:00
RepeatMultiple bug fix
Repeat amount could be 0
This commit is contained in:
parent
8b6ed9ddf9
commit
1f75d0189b
1 changed files with 4 additions and 1 deletions
|
|
@ -53,7 +53,10 @@ class RepeatMultiple(Effect):
|
|||
|
||||
def apply(self, clip: Clip) -> Clip:
|
||||
random_dur = self.rng.uniform(self.repeat_video_duration_min, self.repeat_video_duration_max)
|
||||
repeat_amt = int((clip.duration / random_dur) * 0.5)
|
||||
repeat_amt = min(
|
||||
int((clip.duration / random_dur) * 0.5),
|
||||
2
|
||||
)
|
||||
|
||||
start_offset = self.rng.uniform(0, clip.duration - random_dur)
|
||||
new_clip = clip.subclipped(start_offset, start_offset + random_dur)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue