Added opacity setting to the screen shots
This commit is contained in:
1 parent
db1ddce57a
commit
5f2070d344
2 files changed
+14
-3
No files matched your search
@@ -9,3 +9,6 @@ REDDIT_2FA=""
|
||||
THEME=""
|
||||
|
||||
SUBREDDIT=""
|
||||
|
||||
# Range is 0 -> 1
|
||||
OPACITY=""
|
||||
@@ -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")
|
||||
|
||||
Reference in new issue
Block a user