Skip to content

Video editing with Python

Fix 'Clip.cutout' transformation not being applied properly (#1468)

Álvaro Mondéjar3ebede0c1062
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e7f605f4..bc319691 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed calling `audio_normalize` on a clip with no sound causing `ZeroDivisionError` [\#1401](https://github.com/Zulko/moviepy/pull/1401)
- Fixed `freeze` FX was freezing at time minus 1 second as the end [\#1461](https://github.com/Zulko/moviepy/pull/1461)
- `AudioClip.max_volume(stereo=True)` now can return more than 2 channels [\#1464](https://github.com/Zulko/moviepy/pull/1464)
+- Fixed `Clip.cutout` transformation not being applied to audio [\#1468](https://github.com/Zulko/moviepy/pull/1468)
## [v2.0.0.dev2](https://github.com/zulko/moviepy/tree/v2.0.0.dev2) (2020-10-05)
diff --git a/moviepy/Clip.py b/moviepy/Clip.py
index 89a9758a..223bfcb0 100644
--- a/moviepy/Clip.py
+++ b/moviepy/Clip.py
@@ -411,8 +411,6 @@ class Clip:
return new_clip
- @apply_to_mask
- @apply_to_audio
@convert_parameter_to_seconds(["start_time", "end_time"])
def cutout(self, start_time, end_time):
"""
@@ -429,15 +427,13 @@ class Clip:
"""
new_clip = self.time_transform(
- lambda t: t + (t >= start_time) * (end_time - start_time)
+ lambda t: t + (t >= start_time) * (end_time - start_time),
+ apply_to=["audio", "mask"],
)
if self.duration is not None:
-
return new_clip.with_duration(self.duration - (end_time - start_time))
-
else:
-
return new_clip
@requires_duration