1#install moviepy via pip
2pip install moviepy
3
4#We can import some python libraries before starting to merge videos.
5from moviepy.editor import VideoFileClip, concatenate_videoclips
6
7#we use VideoFileClip() class create two video object, then we will merge them.
8video_1 = VideoFileClip("VideoExample1.mp4")
9video_2 = VideoFileClip("VideoExample2.mp4")
10
11#Merge videos with concatenate_videoclips()
12final_video= concatenate_videoclips([video_1, video_2])
13
14final_video.write_videofile("final_video.mp4")