|
|
@@ -0,0 +1,52 @@ |
|
|
|
#!/bin/python3 |
|
|
|
|
|
|
|
import moviepy.editor as mp |
|
|
|
|
|
|
|
COMPILATION_CLIP = "../autohighlights/test.mkv" |
|
|
|
LOGO = "/home/robert/downloads/ror2_logo_512-1.png" |
|
|
|
|
|
|
|
|
|
|
|
def blur(img): |
|
|
|
from skimage.filters import gaussian |
|
|
|
|
|
|
|
return gaussian(img.astype(float), sigma=1.5) |
|
|
|
|
|
|
|
|
|
|
|
def blur_more(img): |
|
|
|
from skimage.filters import gaussian |
|
|
|
|
|
|
|
return gaussian(img.astype(float), sigma=3.5) |
|
|
|
|
|
|
|
|
|
|
|
mainclip = mp.VideoFileClip(COMPILATION_CLIP, audio=True) |
|
|
|
mainclip = mainclip.volumex(0.1) |
|
|
|
mainclip = mainclip.fx(mp.vfx.speedx, 1.3) |
|
|
|
mainclip = mainclip.fl_image(blur) |
|
|
|
|
|
|
|
logoclip = mp.ImageClip(LOGO) |
|
|
|
textclip = mp.TextClip("Risk of Rain 2 Prerelease", |
|
|
|
font="RiskofRainFont-Regular", |
|
|
|
fontsize=85, |
|
|
|
color="#e0e0e0", |
|
|
|
stroke_color="#1a1a1a", |
|
|
|
stroke_width=2) |
|
|
|
|
|
|
|
textclip2 = mp.TextClip("Risk of Rain 2 Prerelease", |
|
|
|
font="RiskofRainFont-Regular", |
|
|
|
fontsize=86, |
|
|
|
color='#101010') |
|
|
|
|
|
|
|
textclip = textclip.set_duration(mainclip.duration) |
|
|
|
|
|
|
|
logoclip = logoclip.set_duration(mainclip.duration) |
|
|
|
|
|
|
|
|
|
|
|
composite = mp.CompositeVideoClip( |
|
|
|
[mainclip.fadein(0.5).fadeout(0.5), |
|
|
|
logoclip.set_position((0.7, 0.8), relative=True), |
|
|
|
textclip.set_position((0.05, 0.05), relative=True)]) |
|
|
|
|
|
|
|
# composite.preview() |
|
|
|
composite.write_videofile("ror2_prerelease_intro.mkv", codec="libx264", |
|
|
|
audio_codec="aac") |
|
|
|
# ffmpeg_params=["-crf", "20"], codec="h264") |