ScriptsMar 29, 2026·1 min read

MoviePy — Python Video Editing Library

Python library for video editing: cutting, concatenating, adding titles, effects, and audio. Script-based video production for automation pipelines.

TO
TokRepo精选 · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

pip install moviepy
from moviepy import VideoFileClip, TextClip, CompositeVideoClip

video = VideoFileClip("input.mp4").subclipped(0, 10)
title = TextClip(text="Hello World", font_size=70, color="white", font="Arial")
title = title.with_duration(5).with_position("center")
result = CompositeVideoClip([video, title])
result.write_videofile("output.mp4")

Intro

MoviePy is a Python library for video editing — cutting, concatenating, adding text overlays, transitions, and effects through code. No GUI needed. Perfect for building automated video production pipelines where you need to programmatically assemble, transform, and export videos. 13,000+ GitHub stars.

Best for: Automated video assembly, batch processing, adding overlays/titles to existing footage Works with: Python 3.9+, FFmpeg (auto-installed) Setup time: 2 minutes


Key Operations

Cut and trim

clip = VideoFileClip("video.mp4").subclipped(10, 60)  # 10s to 60s

Concatenate clips

from moviepy import concatenate_videoclips
final = concatenate_videoclips([clip1, clip2, clip3])

Add text overlay

txt = TextClip(text="Subscribe!", font_size=40, color="yellow", font="Arial")
txt = txt.with_duration(3).with_position(("center", "bottom"))

Resize and speed

clip = clip.resized(width=1080)
clip = clip.with_speed_scaled(2.0)  # 2x speed

FAQ

Q: What is MoviePy? A: A Python library for video editing through code — cut, concatenate, overlay text, apply effects, and export videos programmatically without a GUI.

Q: Is MoviePy free? A: Yes. MoviePy is MIT-licensed and free to use.


🙏

Source & Thanks

Created by Zulko. Licensed under MIT. moviepy — ⭐ 13,000+ Docs: zulko.github.io/moviepy

Related Assets