jonathanjordan21
commited on
Commit
•
e855c02
1
Parent(s):
bcbe59e
Update components/utils.py
Browse files- components/utils.py +4 -2
components/utils.py
CHANGED
@@ -4,10 +4,12 @@ import os
|
|
4 |
def combine_videos(folder_name):
|
5 |
|
6 |
length = len(os.listdir(folder_name))
|
7 |
-
|
|
|
8 |
|
9 |
combined = concatenate_videoclips(
|
10 |
-
[
|
|
|
11 |
"compose",bg_color=None, padding=0
|
12 |
)
|
13 |
combined.write_videofile(os.path.join(folder_name, "Final_Ad_Video.mp4"))
|
|
|
4 |
def combine_videos(folder_name):
|
5 |
|
6 |
length = len(os.listdir(folder_name))
|
7 |
+
|
8 |
+
vids = [VideoFileClip(os.path.join(folder_name,x)) for x in sorted(os.listdir(folder_name))]
|
9 |
|
10 |
combined = concatenate_videoclips(
|
11 |
+
[vid.subclip(0,7).fx(vfx.fadein,0.5).fx(vfx.fadeout,0.5) if vid.duration > 7 else vid.fx(vfx.fadein,0.5).fx(vfx.fadeout,0.5) for vid in vids],
|
12 |
+
# [VideoFileClip(os.path.join(folder_name,x)).subclip(0,7).fx(vfx.fadein,0.5).fx(vfx.fadeout,0.5) for x in sorted(os.listdir(folder_name))],
|
13 |
"compose",bg_color=None, padding=0
|
14 |
)
|
15 |
combined.write_videofile(os.path.join(folder_name, "Final_Ad_Video.mp4"))
|