Skip to main content

Video editing with Python

Project description

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, for more info, see the updating guide.

MoviePy (full documentation) is a Python library for video editing: cutting, 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.7+.

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:

# Import everything needed to edit video clips
from moviepy import *

# Load file example.mp4 and extract only the subclip from 00:00:10 to 00:00:20
clip = VideoFileClip("long_examples/example2.mp4").with_subclip(10, 20)

# Reduce the audio volume to 80% of his original volume
clip = clip.with_multiply_volume(0.8)

# Generate a text clip. You can customize the font, color, etc.
txt_clip = TextClip(font="example.ttf", text="Big Buck Bunny", font_size=70, color='white')

# Say that you want it to appear for 10s at the center of the screen
txt_clip = txt_clip.with_position('center').with_duration(10)

# Overlay the text clip on the first video clip
video = CompositeVideoClip([clip, txt_clip])

# Write the result to a file (many options available!)
video.write_videofile("result.mp4")

Maintainers wanted!

MoviePy is always looking for maintainers, and 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!

Installation

For standard installation, see documentation_install.

For contributors installation, see documentation_dev_install.

Documentation

Building the documentation has additional dependencies that require installation.

$ (sudo) pip install moviepy[doc]

The documentation can be generated and viewed via:

$ python setup.py build_docs

You can pass additional arguments to the documentation build, such as clean build:

$ python setup.py build_docs -E

More information is available from the Sphinx documentation.

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, ask for help or simply give feedback. Please read our Contributing Guidelines for more information about how to contribute!

You can also discuss the project on Reddit or Gitter. These are preferred over GitHub issues for usage questions and examples.

Maintainers

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moviepy-2.0.0.tar.gz (58.4 MB view details)

Uploaded Source

Built Distribution

moviepy-2.0.0-py3-none-any.whl (123.0 kB view details)

Uploaded Python 3

File details

Details for the file moviepy-2.0.0.tar.gz.

File metadata

  • Download URL: moviepy-2.0.0.tar.gz
  • Upload date:
  • Size: 58.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for moviepy-2.0.0.tar.gz
Algorithm Hash digest
SHA256 3affb0343626f026c11e7a8e42c9b2fbb5b2253e5c8988cb7930c1bd9b0d7c93
MD5 138daa2f2c3c5f2d72e4e4a7bf92687f
BLAKE2b-256 17a63d9c933a55b176d785f747d18222809d96e1194627401093e8ebbbfc8b8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepy-2.0.0.tar.gz:

Publisher: publish.yml on Zulko/moviepy

Attestations:

File details

Details for the file moviepy-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: moviepy-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 123.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for moviepy-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c38f2db676f46c7beafeeb5b545eae88dcc252021500fb2ab3cd248dffd41ca6
MD5 03d0eef3b40db9da103799a0a746bdaf
BLAKE2b-256 a5afb1ac4ed4f88a19dfcad21b210036ae58d274977ac09666f5bd60121817a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepy-2.0.0-py3-none-any.whl:

Publisher: publish.yml on Zulko/moviepy

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page