Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.07k stars 1.51k forks source link

The position of subclip cutting is different from the parameters #2175

Closed FlyDogDaDa closed 1 month ago

FlyDogDaDa commented 1 month ago

Expected Behavior

No ValueError is raised during the process and then get printed:

314.7 315.69
315.9 316.05

Actual Behavior

getting error: ValueError: t_start (314.70) should be smaller than the clip's duration (312.01). and then get printed:

314.7 315.69

Steps to Reproduce the Problem

from moviepy.editor import VideoFileClip

original_video = VideoFileClip(video_path)
clips = []
for start, end in [(314.7, 315.69), (315.9, 316.05)]:
    print(start, end)
    clips.append(original_video.subclip(start, end))

Specifications

FlyDogDaDa commented 1 month ago

I've been confused for a long time why moviepy doesn't use integer milliseconds but float seconds. I'm like: (*´・д・)?