|
|
|
@ -8,12 +8,18 @@ from moviepy.editor import (
|
|
|
|
|
CompositeVideoClip,
|
|
|
|
|
)
|
|
|
|
|
from utils.console import print_step
|
|
|
|
|
|
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
W, H = 1080, 1920
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def make_final_video(number_of_clips):
|
|
|
|
|
# Calls opacity from the .env
|
|
|
|
|
load_dotenv()
|
|
|
|
|
opacity = os.getenv('OPACITY')
|
|
|
|
|
|
|
|
|
|
print_step("Creating the final video...")
|
|
|
|
|
VideoFileClip.reW = lambda clip: clip.resize(width=W)
|
|
|
|
|
VideoFileClip.reH = lambda clip: clip.resize(width=H)
|
|
|
|
@ -39,14 +45,16 @@ def make_final_video(number_of_clips):
|
|
|
|
|
ImageClip(f"assets/png/comment_{i}.png")
|
|
|
|
|
.set_duration(audio_clips[i + 1].duration)
|
|
|
|
|
.set_position("center")
|
|
|
|
|
.resize(width=W - 100),
|
|
|
|
|
.resize(width=W - 100)
|
|
|
|
|
.set_opacity(float(opacity)),
|
|
|
|
|
)
|
|
|
|
|
image_clips.insert(
|
|
|
|
|
0,
|
|
|
|
|
ImageClip(f"assets/png/title.png")
|
|
|
|
|
.set_duration(audio_clips[0].duration)
|
|
|
|
|
.set_position("center")
|
|
|
|
|
.resize(width=W - 100),
|
|
|
|
|
.resize(width=W - 100)
|
|
|
|
|
.set_opacity(float(opacity)),
|
|
|
|
|
)
|
|
|
|
|
image_concat = concatenate_videoclips(image_clips).set_position(
|
|
|
|
|
("center", "center")
|
|
|
|
|