from moviepy.editor import VideoFileClip clip = VideoFileClip("sample.mp4") duration = clip.duration width = clip.w print("Video duration: ", duration, ", Video width: ", width)
from moviepy.editor import AudioFileClip, VideoFileClip video = VideoFileClip("sample.mp4") audio = video.audio audio.write_audiofile("output.mp3")
from moviepy.editor import CompositeVideoClip, VideoFileClip video1 = VideoFileClip("video1.mp4") video2 = VideoFileClip("video2.mp4") final_video = CompositeVideoClip([video1, video2]) final_video.write_videofile("final.mp4")In conclusion, MoviePy is an amazing video editing package for python developers who prioritize flexibility and automation. It offers a rich set of features and modules which makes video editing tasks easier and faster.