I want a transition of a clip sliding so the other clip appears
from moviepy.editor import ImageClip, AudioFileClip, concatenate_videoclips, vfx
image1 = ImageClip('Video.png')
image2 = ImageClip('Video-1.png')
image3 = ImageClip('Video-2.png')
audio1 = AudioFileClip('audio1.mp3')
audio2 = AudioFileClip('audio2.mp3')
audio3 = AudioFileClip('audio3.mp3')
transition12 = int(audio1.duration-1)
transition23 = int(audio2.duration-1)
clip3 = image3.set_duration(audio3.duration)
clip2 = image2.set_duration(audio2.duration).fx(vfx.scroll,clip3,x_speed=1,x_start=2)
clip1 = image1.set_duration(audio1.duration).fx(vfx.scroll,clip2,x_speed=1,x_start=transition12)
Video1= clip1.set_audio(audio1)
Video2= clip2.set_audio(audio2)
Video3= clip3.set_audio(audio3)
Video_final = concatenate_videoclips([Video1,Video2,Video3])
Here using this way it gives me an error TypeError: unsupported operand type(s) for -: 'int' and 'ImageClip' The functions code on the documentation is:
def scroll(clip, h=None, w=None, x_speed=0, y_speed=0,
x_start=0, y_start=0, apply_to="mask"):
""" Scrolls horizontally or vertically a clip, e.g. to make end
credits """
if h is None: h = clip.h
if w is None: w = clip.w
xmax = **clip.w-w-1**
ymax = clip.h-h-1
def f(gf,t):
x = int(max(0, min(xmax, x_start+ round(x_speed*t))))
y = int(max(0, min(ymax, y_start+ round(y_speed*t))))
return gf(t)[y:y+h, x:x+w]
return clip.fl(f, apply_to = apply_to)
I tried debugging and changing the type of the values I entered. Also I have looked at the value of clip.w and its int