pandas 3 Migration Guide: Copy-on-Write, str Dtype, pd.col and Faster read_csv (2026) Python multiprocessing Tutorial: Pool, ProcessPoolExecutor, Queues and Locks (2026) YOLO26 Object Detection in Python with Ultralytics: Detect, Count, Track and Export (2026) Remove Background from Image in Python with rembg: Models, Batch, Masks and CLI (2026) FastAPI File Upload Tutorial: UploadFile, Multiple Files, Validation and Size Limits (2026) Ollama Python Tutorial: Run Local LLMs with Chat, Streaming, Structured Outputs, Tools and Embeddings (2026) Python sqlite3 Tutorial: Tables, Transactions, JSON and Upserts with the Built-in Database (2026) Convert Python to EXE with PyInstaller: One-File Apps, Data Files and Hidden Imports (2026) Two-Factor Authentication in Python with pyotp: TOTP, QR Codes and FastAPI (2026) Hash Passwords in Python with Argon2: pwdlib, argon2-cffi and bcrypt Migration (2026) Encrypt and Decrypt in Python with Fernet: Strings, Files and Passwords (2026) psutil Tutorial: Monitor CPU, Memory, Disk and Processes in Python (2026) PyMuPDF Tutorial: PDF to Image, Extract Text and Images in Python (2026) MoviePy 2 Tutorial: Edit Videos with Python (Trim, Text, Merge, Audio) 2026 FastAPI Dependency Injection with Depends: Annotated, Yield and Overrides (2026) HTML to PDF in Python with WeasyPrint and Jinja2: Invoices and Reports (2026) Extract Tables from PDF in Python with pdfplumber: CSV, Excel and pandas (2026) OCR in Python: Extract Text from Images and Scanned PDFs with RapidOCR (2026) Text to Speech in Python with Piper: Offline Natural Voices, WAV Files and a TTS API (2026) Speech to Text in Python with faster-whisper: Transcribe Audio and Make Subtitles (2026) Send Email with Python: smtplib, HTML, Attachments and Bulk Mail (2026) Python QR Code Generator: Styled QR Codes with qrcode (2026) Pillow 13: Resize, Crop and Watermark Images in Python (2026) Parallel Programming with Dask in Python 2026: Intro Guide MarkItDown: Convert Files to Markdown for LLMs in Python (2026) Plotly Express: Interactive Charts in Python (2026) pandera: Validate pandas DataFrames in Python (2026) jsonschema: Validate JSON Data in Python (2026) Faker: Generate Fake Test Data in Python (2026) RapidFuzz: Fuzzy String Matching in Python (2026) View all in this category →

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

Watch on YouTube

Chapters

  1. 0:0001. Intro: what we'll build
  2. 0:4302. Install MoviePy 2 and make sample clips
  3. 1:5003. Load a clip and inspect it
  4. 2:4404. Trim with subclipped (and the subclip error)
  5. 3:5405. Add a text overlay with TextClip
  6. 5:2306. Merge clips with concatenate_videoclips
  7. 6:1107. Transitions: FadeIn and FadeOut with with_effects
  8. 7:1808. Audio: AudioFileClip, volume and mixing
  9. 8:2409. Resize and export a 9:16 vertical Short
  10. 9:2010. Mini project: automatic highlight reel
  11. 11:3111. MoviePy 1.x to 2.x cheat sheet and recap

What's in the zip

  • moviepy-2-tutorial/.gitignore
  • moviepy-2-tutorial/01_inspect.py
  • moviepy-2-tutorial/02_trim.py
  • moviepy-2-tutorial/03_text.py
  • moviepy-2-tutorial/04_merge.py
  • moviepy-2-tutorial/05_fades.py
  • moviepy-2-tutorial/06_audio.py
  • moviepy-2-tutorial/07_shorts.py
  • moviepy-2-tutorial/HOW_TO_RUN.txt
  • moviepy-2-tutorial/LICENSE
  • moviepy-2-tutorial/MANIFEST.sha256
  • moviepy-2-tutorial/README.md
  • moviepy-2-tutorial/fonts/DejaVuSans-Bold.ttf
  • moviepy-2-tutorial/fonts/LICENSE-DejaVu.txt
  • moviepy-2-tutorial/highlight_reel.py
  • moviepy-2-tutorial/make_samples.py
  • moviepy-2-tutorial/make_samples.sh
  • moviepy-2-tutorial/migration_notes.py
  • moviepy-2-tutorial/requirements.txt
  • moviepy-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.py

See 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.

Download source code

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.