MoviePy 2 Tutorial 2026: Edit Videos with Python (Trim, Text, Merge) – Source Code
Learn MoviePy 2, the current version of the Python video editing library: load and inspect clips, trim with subclipped, add text with TextClip, merge with concatenate_videoclips, FadeIn and FadeOut with with_effects, mix audio with afx, export a 1080x1920 vertical Short, and build an automatic highlight reel. Includes a MoviePy 1.x to 2.x cheat sheet.
- Duration
- 12:45 (11 chapters)
- Tools
- MoviePy 2.2.1, Python 3.13, imageio-ffmpeg, ffmpeg (sample clips), VS Code, bash
Watch the tutorial
Chapters
- 0:0001. Intro: what we'll build
- 0:4302. Install MoviePy 2 and make sample clips
- 1:5003. Load a clip and inspect it
- 2:4404. Trim with subclipped (and the subclip error)
- 3:5405. Add a text overlay with TextClip
- 5:2306. Merge clips with concatenate_videoclips
- 6:1107. Transitions: FadeIn and FadeOut with with_effects
- 7:1808. Audio: AudioFileClip, volume and mixing
- 8:2409. Resize and export a 9:16 vertical Short
- 9:2010. Mini project: automatic highlight reel
- 11:3111. MoviePy 1.x to 2.x cheat sheet and recap
What's in the zip
moviepy-2-tutorial/.gitignoremoviepy-2-tutorial/01_inspect.pymoviepy-2-tutorial/02_trim.pymoviepy-2-tutorial/03_text.pymoviepy-2-tutorial/04_merge.pymoviepy-2-tutorial/05_fades.pymoviepy-2-tutorial/06_audio.pymoviepy-2-tutorial/07_shorts.pymoviepy-2-tutorial/HOW_TO_RUN.txtmoviepy-2-tutorial/LICENSEmoviepy-2-tutorial/MANIFEST.sha256moviepy-2-tutorial/README.mdmoviepy-2-tutorial/fonts/DejaVuSans-Bold.ttfmoviepy-2-tutorial/fonts/LICENSE-DejaVu.txtmoviepy-2-tutorial/highlight_reel.pymoviepy-2-tutorial/make_samples.pymoviepy-2-tutorial/make_samples.shmoviepy-2-tutorial/migration_notes.pymoviepy-2-tutorial/requirements.txtmoviepy-2-tutorial/short_after.py
How to run
Python 3.10+ (tested with 3.13). Works on Windows, macOS and Linux. Run every command from the folder.
python -m venv .venv
source .venv/bin/activate (Windows: .venv\Scripts\activate)
pip install -r requirements.txt
python make_samples.py
python 01_inspect.py
python highlight_reel.pySee HOW_TO_RUN.txt for every lesson in order, and migration_notes.py for the MoviePy 1.x to 2.x renames (subclip to subclipped, set_ to with_, fx to with_effects).
Media
No video files are bundled. make_samples.py generates four royalty-free sample clips and a soft tone with the ffmpeg that ships with MoviePy. The DejaVu Sans Bold font is included under its own free licence.
Next step
Want more Python? The free Python for Data Engineering full course code is here too.
File: moviepy-2-tutorial-code.zip
Size: 357.0 KB (365,543 bytes)
SHA-256:8e75f4a68c47049009f2d01e515d46706b0eaf29dcd98a61132017e612a93566
Licence: code is released under the MIT licence, copyright PyInns. See LICENSE and README inside the zip. Free learning code, not production code.