Spaces:
Sleeping
Sleeping
Eyuvaraj
commited on
Commit
·
768cd5c
1
Parent(s):
f20f77f
minor updates
Browse files- .gitignore +4 -0
- output.mp4 +0 -0
- utils.py +4 -24
.gitignore
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
venv/
|
2 |
+
clips/
|
3 |
+
__pycache__/
|
4 |
+
output.mp4
|
output.mp4
CHANGED
Binary files a/output.mp4 and b/output.mp4 differ
|
|
utils.py
CHANGED
@@ -114,7 +114,7 @@ def create_advanced_video(number, trim_settings, output_file="output.mp4"):
|
|
114 |
intro_file = "trimmed_clips/Intro_cut.mp4"
|
115 |
conclusion_file = "trimmed_clips/Conclusion_cut.mp4"
|
116 |
|
117 |
-
clips_to_combine = [intro_file]
|
118 |
clips = generate_clip_sequence(number)
|
119 |
|
120 |
video_clips = []
|
@@ -128,30 +128,10 @@ def create_advanced_video(number, trim_settings, output_file="output.mp4"):
|
|
128 |
print(f"Error loading clip {clip_path}: {e}")
|
129 |
|
130 |
clips_to_combine.extend(video_clips)
|
131 |
-
clips_to_combine.append(conclusion_file)
|
132 |
|
133 |
if video_clips:
|
134 |
-
final_video = concatenate_videoclips(
|
135 |
final_video.write_videofile(output_file, codec="libx264", audio_codec="aac")
|
136 |
else:
|
137 |
-
print("No clips to combine. Video creation failed.")
|
138 |
-
|
139 |
-
# def main():
|
140 |
-
# """
|
141 |
-
# Main function to repeatedly prompt user input and generate videos.
|
142 |
-
# """
|
143 |
-
# while True:
|
144 |
-
# try:
|
145 |
-
# number = int(input("Enter a number between 1 and 9999999 (or 0 to exit): "))
|
146 |
-
# if number == 0:
|
147 |
-
# print("Exiting...")
|
148 |
-
# break
|
149 |
-
# elif number < 1 or number > 9999999:
|
150 |
-
# print("Invalid input. Please enter a number between 1 and 9999999.")
|
151 |
-
# continue
|
152 |
-
# create_video(number)
|
153 |
-
# except ValueError:
|
154 |
-
# print("Invalid input. Please enter a valid number.")
|
155 |
-
|
156 |
-
# if __name__ == "__main__":
|
157 |
-
# main()
|
|
|
114 |
intro_file = "trimmed_clips/Intro_cut.mp4"
|
115 |
conclusion_file = "trimmed_clips/Conclusion_cut.mp4"
|
116 |
|
117 |
+
clips_to_combine = [VideoFileClip(intro_file)]
|
118 |
clips = generate_clip_sequence(number)
|
119 |
|
120 |
video_clips = []
|
|
|
128 |
print(f"Error loading clip {clip_path}: {e}")
|
129 |
|
130 |
clips_to_combine.extend(video_clips)
|
131 |
+
clips_to_combine.append(VideoFileClip(conclusion_file))
|
132 |
|
133 |
if video_clips:
|
134 |
+
final_video = concatenate_videoclips(clips_to_combine)
|
135 |
final_video.write_videofile(output_file, codec="libx264", audio_codec="aac")
|
136 |
else:
|
137 |
+
print("No clips to combine. Video creation failed.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|