|
@@ -0,0 +1,42 @@ |
|
|
|
|
|
#!/bin/python3 |
|
|
|
|
|
# |
|
|
|
|
|
# apex_spedup.py - generate sped up videos of Apex |
|
|
|
|
|
|
|
|
|
|
|
import moviepy.editor as mp |
|
|
|
|
|
import glob |
|
|
|
|
|
import os |
|
|
|
|
|
|
|
|
|
|
|
INPUTVIDEO = "/tmp/footage/gamefootage/pending/apex/2020-12-05 17-29-55.mkv" |
|
|
|
|
|
|
|
|
|
|
|
WORKINGDIR = "/tmp/footage/gamefootage/pending/apex" |
|
|
|
|
|
PATTERN = "2020-12-05*.mkv" |
|
|
|
|
|
|
|
|
|
|
|
for filepath in glob.glob(os.path.join(WORKINGDIR, PATTERN)): |
|
|
|
|
|
inputvideo = filepath |
|
|
|
|
|
outputvideo = str(inputvideo).replace(".mkv", "-spedup.mkv") |
|
|
|
|
|
print("Converting {} to {}".format(inputvideo, outputvideo)) |
|
|
|
|
|
|
|
|
|
|
|
clip = mp.VideoFileClip(inputvideo, audio=False) |
|
|
|
|
|
clip = clip.fadein(0.5).fadeout(0.5) |
|
|
|
|
|
newclip = clip.fx(mp.vfx.accel_decel, 60) |
|
|
|
|
|
|
|
|
|
|
|
logoclip = mp.ImageClip("/home/robert/downloads/apex-logo2.png") |
|
|
|
|
|
|
|
|
|
|
|
# Duke-Fill |
|
|
|
|
|
# textclip = mp.TextClip("Recorded without audio so sped up", |
|
|
|
|
|
# font="Blocktastic", |
|
|
|
|
|
# fontsize=50, |
|
|
|
|
|
# color="#e0e0e0") |
|
|
|
|
|
|
|
|
|
|
|
textclip = mp.ImageClip("/home/robert/downloads/sped_up.png") |
|
|
|
|
|
|
|
|
|
|
|
logoclip = logoclip.set_duration(newclip.duration).set_opacity(0.6) |
|
|
|
|
|
textclip = textclip.set_duration(newclip.duration).set_opacity(0.8) |
|
|
|
|
|
|
|
|
|
|
|
composite = mp.CompositeVideoClip( |
|
|
|
|
|
[newclip, |
|
|
|
|
|
logoclip.set_position((0.75, 0.65), relative=True), |
|
|
|
|
|
textclip.set_position((0.05, 0.8), relative=True)]) |
|
|
|
|
|
|
|
|
|
|
|
# composite.preview() |
|
|
|
|
|
composite.write_videofile(outputvideo, codec="libx264", threads=6) |