Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Video editing with Python

License

NotificationsYou must be signed in to change notification settings

Zulko/moviepy

Repository files navigation

MoviePy page on the Python Package IndexDiscuss MoviePy on GitterBuild status on gh-actionsCode coverage from coveralls.io

Note

MoviePy recently upgraded to v2.0, introducing major breaking changes. You can consult the last v1 docshere but beware that v1 is no longer maintained. For more info on how to update your code from v1 to v2, seethis guide.

MoviePy (online documentationhere) 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 and20 seconds, add a title at the center of the screen, and write theresult to a new file:

frommoviepyimportVideoFileClip,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 volumeclip= (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 clipfinal_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 thebuilt-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 withpip install moviepy. For additional installation options, such as a custom FFMPEG or for previewing, seethis section. For development, clone that repo locally and install withpip 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 viapip install "moviepy[doc]", then go to thedocs folder and runmake html.

Contribute

MoviePy is open-source software originally written byZulko and released under the MIT licence.The project is hosted onGitHub,where everyone is welcome to contribute and open issues or give feedback Please read ourContributingGuidelines.To ask for help or simply discuss usage and examples, useour 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. Openan issue or contact us directly if you are interested. Thanks!


[8]ページ先頭

©2009-2026 Movatter.jp