Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.07k stars 1.51k forks source link

Can't apply transition 'crossfadein' to a clip #2096

Closed alessandro-candon closed 5 months ago

alessandro-candon commented 5 months ago

Hi, I find some snippet online to apply a transition when I concatenate videos, however it seems not working for me. What I'm doing wrong? This is an extraction of the code :

clip1 = VideoFileClip("out.mp4")
clip1.crossfadein(1)

This is the full example

clip1 = VideoFileClip("out.mp4")
clip2 = VideoFileClip("out.mp4")

clips = [clip1, clip2]

fade_duration = 1
clips = [clip.crossfadein(fade_duration) for clip in clips]

final_clip = concatenate_videoclips(clips, padding = -fade_duration)

final_clip.write_videofile("final.mp4")

Seems VideoFileClip don't have the method crossfadein.

Thank you!

alessandro-candon commented 5 months ago

Hi all, maybe this snippet can help also other people :

from moviepy.video.fx.fadein import fadein
clip = fadein(clip, 0.2)

I hope this help...