Skip to content

Video editing with Python

Fix wrong fps calculation

osaajani5541a1d1e611
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d8f0b4d..42d02ee7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve perfs of decorator by pre-computing arguments
- Fix textclip being cut or of impredictable height (see issues #2325, #2260 and #2268)
- Fix TimeMirror and TimeSymmetrize cutting last second of clip
+- ImageSequenceClip was wrong when calculating fps with duration and no fps (see issue #2351)
## [v2.1.2](https://github.com/zulko/moviepy/tree/master)
diff --git a/moviepy/video/io/ImageSequenceClip.py b/moviepy/video/io/ImageSequenceClip.py
index 96b407f0..f1e6588c 100644
--- a/moviepy/video/io/ImageSequenceClip.py
+++ b/moviepy/video/io/ImageSequenceClip.py
@@ -110,7 +110,7 @@ class ImageSequenceClip(VideoClip):
self.sequence = sequence
if fps is None:
- self.fps = self.duration / len(sequence)
+ self.fps = len(sequence) / self.duration
def find_image_index(t):
return max(