File: crossfadein.py

package info (click to toggle)
moviepy 2.1.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 96,920 kB
  • sloc: python: 10,566; makefile: 150; sh: 6
file content (15 lines) | stat: -rw-r--r-- 460 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""In this example, we will concatenate two clips with a 1-second
crossfadein of the second clip."""

from moviepy import VideoFileClip, CompositeVideoClip, vfx

# We load all the clips we want to compose
clip1 = VideoFileClip("example.mp4")
clip2 = VideoFileClip("example2.mp4")

clips = [
    clip1.with_end(2),
    clip2.with_start(1).with_effects([vfx.CrossFadeIn(1)]),
]
final_clip = CompositeVideoClip(clips)
final_clip.write_videofile("final_clip.mp4")