mirror of
https://github.com/chev2/shitpost-video-generator.git
synced 2026-04-25 20:22:14 +00:00
Don't let duplicated clips go past the final video duration
Forgot to account for the clip's duration
This commit is contained in:
parent
1385dff2b7
commit
003d4ff6c8
1 changed files with 1 additions and 1 deletions
2
main.py
2
main.py
|
|
@ -195,7 +195,7 @@ with tqdm(desc="Compiling sounds", total=len(randomSounds)) as pbar:
|
|||
|
||||
dupe_clip_position = clipPosition + ((i * 0.9) * rng.uniform(0.8, 1.2))
|
||||
# If the duplicate clip goes over the final video duration, simply discard that duplicate clip
|
||||
if dupe_clip_position > finalVideo.duration:
|
||||
if (dupe_clip_position + newClip.duration) > finalVideo.duration:
|
||||
continue
|
||||
|
||||
"""# Max 0 and clip position - 2 so it doesn't go into negative clip position (if near beginning of video)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue