Skip to content

Video editing with Python

Merge master into v2

Tom Burrows5667902895fc
diff --cc moviepy/video/compositing/transitions.py
index 649565bf,db381512..8b4ea356
--- a/moviepy/video/compositing/transitions.py
+++ b/moviepy/video/compositing/transitions.py
@@@ -106,14 -106,12 +108,14 @@@ def slide_out(clip, duration, side)
"""
- w,h = clip.size
- ts = clip.duration - duration # start time of the effect.
- pos_dict = {'left' : lambda t: (min(0,w*(-(t-ts)/duration)),'center'),
- 'right' : lambda t: (max(0,w*((t-ts)/duration)),'center'),
- 'top' : lambda t: ('center',min(0,h*(-(t-ts)/duration))),
- 'bottom': lambda t: ('center',max(0,h*((t-ts)/duration))) }
+ w, h = clip.size
+ ts = clip.duration - duration # start time of the effect.
+ pos_dict = {
- "left": lambda t: (min(0, w * (1 - (t - ts) / duration)), "center"),
- "right": lambda t: (max(0, w * ((t - ts) / duration - 1)), "center"),
- "top": lambda t: ("center", min(0, h * (1 - (t - ts) / duration))),
- "bottom": lambda t: ("center", max(0, h * ((t - ts) / duration - 1))),
++ "left": lambda t: (min(0, w * (-(t - ts) / duration)), "center"),
++ "right": lambda t: (max(0, w * ((t - ts) / duration)), "center"),
++ "top": lambda t: ("center", min(0, h * (-(t - ts) / duration))),
++ "bottom": lambda t: ("center", max(0, h * ((t - ts) / duration))),
+ }
return clip.set_position(pos_dict[side])