Skip to content

Video editing with Python

🐛 修复Bug

KimigaiiWuyia351edd3399c
diff --git a/moviepy/Clip.py b/moviepy/Clip.py
index b12fc65f..710c0a14 100644
--- a/moviepy/Clip.py
+++ b/moviepy/Clip.py
@@ -206,10 +206,10 @@ class Clip:
return new_clip
+ @outplace
@apply_to_mask
@apply_to_audio
@convert_parameter_to_seconds(["t"])
- @outplace
def with_start(self, t, change_end=True):
"""Returns a copy of the clip, with the ``start`` attribute set
to ``t``, which can be expressed in seconds (15.35), in (min, sec),
@@ -247,10 +247,10 @@ class Clip:
elif self.end is not None:
self.duration = self.end - self.start
+ @outplace
@apply_to_mask
@apply_to_audio
@convert_parameter_to_seconds(["t"])
- @outplace
def with_end(self, t):
"""Returns a copy of the clip, with the ``end`` attribute set to ``t``,
which can be expressed in seconds (15.35), in (min, sec), in
@@ -281,10 +281,10 @@ class Clip:
else:
self.duration = self.end - self.start
+ @outplace
@apply_to_mask
@apply_to_audio
@convert_parameter_to_seconds(["duration"])
- @outplace
def with_duration(self, duration, change_end=True):
"""Returns a copy of the clip, with the ``duration`` attribute set to
``t``, which can be expressed in seconds (15.35), in (min, sec), in
diff --git a/moviepy/audio/AudioClip.py b/moviepy/audio/AudioClip.py
index 3a04b40e..293445f3 100644
--- a/moviepy/audio/AudioClip.py
+++ b/moviepy/audio/AudioClip.py
@@ -6,6 +6,7 @@
import numbers
import os
+from typing import List
import numpy as np
import proglog
@@ -420,7 +421,7 @@ class CompositeAudioClip(AudioClip):
return zero + sum(sounds)
-def concatenate_audioclips(clips):
+def concatenate_audioclips(clips: List[AudioClip]):
"""Concatenates one AudioClip after another, in the order that are passed
to ``clips`` parameter.
diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.py
index 0b22a6d5..6cdc8ee4 100644
--- a/moviepy/video/VideoClip.py
+++ b/moviepy/video/VideoClip.py
@@ -965,8 +965,8 @@ class VideoClip(Clip):
"""Remove the clip's mask."""
self.mask = None
- @add_mask_if_none
@outplace
+ @add_mask_if_none
def with_opacity(self, opacity):
"""Set the opacity/transparency level of the clip.
@@ -975,8 +975,8 @@ class VideoClip(Clip):
"""
self.mask = self.mask.image_transform(lambda pic: opacity * pic)
- @apply_to_mask
@outplace
+ @apply_to_mask
def with_position(self, pos, relative=False):
"""Set the clip's position in compositions.
@@ -1009,8 +1009,8 @@ class VideoClip(Clip):
else:
self.pos = lambda t: pos
- @apply_to_mask
@outplace
+ @apply_to_mask
def with_layer_index(self, index):
"""Set the clip's layer in compositions. Clips with a greater ``layer``
attribute will be displayed on top of others.