Created
November 13, 2022 17:36
-
-
Save nwizugbesamson/6fc0fa72ffd485e84bb8629217e0d138 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#We can import some python libraries before starting to merge videos. | |
from moviepy.editor import VideoFileClip, concatenate_videoclips | |
import time | |
start = time.time() | |
#we use VideoFileClip() class create two video object, then we will merge them. | |
video_1 = VideoFileClip("data/Video/VideoExample1.mp4") | |
video_2 = VideoFileClip("data/Video/VideoExample2.mp4") | |
#Merge videos with concatenate_videoclips() | |
final_video= concatenate_videoclips([video_1, video_2]) | |
final_video.write_videofile("data/Video/final_video.mp4") | |
duration = time.time() - start | |
print(f"Program runtime: {duration}s") | |
## final video size is sum of individual video sizes | |
## two videos of 3+ mb and of 8 seconds duration concatenated in 13 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment