Spaces:
Running
Running
| from moviepy.editor import concatenate_videoclips | |
| import os | |
| def compose_video(video_paths): | |
| clips = [] | |
| for path in video_paths: | |
| if os.path.exists(path): | |
| from moviepy.editor import VideoFileClip | |
| clips.append(VideoFileClip(path)) | |
| final = concatenate_videoclips(clips, method="compose") | |
| out_path = "assets/final_video.mp4" | |
| final.write_videofile(out_path, fps=24, audio_codec="aac", verbose=False, logger=None) | |
| return out_path |