Skip to main content

MoviePy

MoviePy page on the Python Package Index Discuss MoviePy on Gitter Build status on gh-actions Code coverage from coveralls.io

[!NOTE] MoviePy recently upgraded to v2.0, introducing major breaking changes. You can consult the last v1 docs here but beware that v1 is no longer maintained. For more info on how to update your code from v1 to v2, see this guide.

MoviePy (online documentation here) is a Python library for video editing: cuts, concatenations, title insertions, video compositing (a.k.a. non-linear editing), video processing, and creation of custom effects.

MoviePy can read and write all the most common audio and video formats, including GIF, and runs on Windows/Mac/Linux, with Python 3.9+.

Example

In this example we open a video file, select the subclip between 10 and 20 seconds, add a title at the center of the screen, and write the result to a new file:

from moviepy import VideoFileClip, TextClip, CompositeVideoClip

# Load file example.mp4 and keep only the subclip from 00:00:10 to 00:00:20
# Reduce the audio volume to 80% of its original volume

clip = (
    VideoFileClip("long_examples/example2.mp4")
    .subclipped(10, 20)
    .with_volume_scaled(0.8)
)

# Generate a text clip. You can customize the font, color, etc.
txt_clip = TextClip(
    font="Arial.ttf",
    text="Hello there!",
    font_size=70,
    color='white'
).with_duration(10).with_position('center')

# Overlay the text clip on the first video clip
final_video = CompositeVideoClip([clip, txt_clip])
final_video.write_videofile("result.mp4")

How MoviePy works

Under the hood, MoviePy imports media (video frames, images, sounds) and converts them into Python objects (numpy arrays) so that every pixel becomes accessible, and video or audio effects can be defined in just a few lines of code (see the built-in effects for examples).

The library also provides ways to mix clips together (concatenations, playing clips side by side or on top of each other with transparency, etc.). The final clip is then encoded back into mp4/webm/gif/etc.

This makes MoviePy very flexible and approachable, albeit slower than using ffmpeg directly due to heavier data import/export operations.

Installation

Intall moviepy with pip install moviepy. For additional installation options, such as a custom FFMPEG or for previewing, see this section. For development, clone that repo locally and install with pip install -e .

Documentation

The online documentation (here) is automatically built at every push to the master branch. To build the documentation locally, install the extra dependencies via pip install moviepy[doc], then go to the docs folder and run make html.

Contribute

MoviePy is open-source software originally written by Zulko and released under the MIT licence. The project is hosted on GitHub, where everyone is welcome to contribute and open issues or give feedback Please read our Contributing Guidelines. To ask for help or simply discuss usage and examples, use our Reddit channel.

Maintainers

Active maintainers

Past maintainers and thanks

Maintainers wanted! this library has only been kept afloat by the involvement of its maintainers, and there are times where none of us have enough bandwidth. We'd love to hear about developers interested in giving a hand and solving some of the issues (especially the ones that affect you) or reviewing pull requests. Open an issue or contact us directly if you are interested. Thanks!

Release files for moviepy 2.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moviepy 2.2.1
File Size Uploaded
moviepy-2.2.1.tar.gz 58.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for moviepy 2.2.1
File Interpreter ABI Platform
moviepy-2.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 58.6 MB

Release files / moviepy-2.2.1.tar.gz

Download URL moviepy-2.2.1.tar.gz
Size 58.4 MB
Tags Source
SHA-256 checksum
How to use checksums
c80cb56815ece94e5e3e2d361aa40070eeb30a09d23a24c4e684d03e16deacb1
BLAKE2b-256 checksum
How to use checksums
de6115f9476e270f64c78a834e7459ca045d669f869cec24eed26807b8cd479d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 21, 2025.

Transparency log

Release files / moviepy-2.2.1-py3-none-any.whl

Download URL moviepy-2.2.1-py3-none-any.whl
Size 129.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b56803fec2ac54b557404126ac1160e65448e03798fa282bd23e8fab3795060
BLAKE2b-256 checksum
How to use checksums
9a737d3b2010baa0b5eb1e4dfa9e4385e89b6716be76f2fa21a6c0fe34b68e5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 21, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.2.1 This release

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.2.3.5

1 release file

0.2.3.4

1 release file

0.2.3.3

1 release file

0.2.3

0.2.2

1 release file

0.2.1.9

1 release file

0.2.1.7

1 release file

0.2.1.6

1 release file

0.2.1.5

1 release file

0.2.1.4

1 release file

0.2.1.3

1 release file

0.2.1.2

1 release file

0.2.1.1

1 release file

0.2.1

1 release file

0.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page