Pymovie

Ʌ: Python

Title card generator

from moviepy.editor import *
from moviepy.video.fx.all import lum_contrast
from moviepy.video.VideoClip import ImageClip
import sys

banner = ImageClip("PMF MAYDAY vid screen.jpg").set_duration(3)

background = lum_contrast(banner, lum=-200, contrast=-0.2).set_duration(5)

text = TextClip(sys.argv[1].replace("|", "\n"), color="white", fontsize=70) \
    .set_duration(background.duration)

title = CompositeVideoClip(
    [background, text.set_pos("center")],
    size=background.size,
)

xfade = CompositeVideoClip([banner, title.set_start(banner.end - 3).crossfadein(3)])

clip = concatenate_videoclips([banner.set_duration(2), xfade, title])


clip.write_videofile(sys.argv[2], fps=30)