Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.0 update for code & documentation #2024

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c3fbfe0
Unify any modification method on clip to use the with_ prefix
Jun 24, 2023
f16b197
harmonize usage of with_ for any modificating method who return a copy
Jun 25, 2023
807c6e1
Correctly import AudioArrayClip
Jun 27, 2023
77dddea
Remove dependency to imagemagick by using only imageio for gif and pi…
Jun 29, 2023
6cba8b7
Missing comma
Jun 30, 2023
5e12d7a
Remove newlines at end of string load from textfiles
Jun 30, 2023
d18ad67
Make DataVideoClip and UpdatedVideoClip part of all when importing mo…
Jul 1, 2023
692af8d
Move concatenate_videoclips from his own file to CompositeVideoClip f…
Jul 1, 2023
b18af4b
Remove the now useless script to get latest imagemagick for windows
Jul 1, 2023
dfbe066
Improve doc videoclip
Jul 5, 2023
01dedee
Remove useless param with_mask from ffmpeg_writer and directly use cl…
Jul 5, 2023
4bf4c3b
Migrate preview to ffplay instead of pygame, making pygame now useles…
Jul 5, 2023
9725733
Fix a bad indentation in audio ffmpeg reader + remove scipy and skima…
Jul 7, 2023
c18a827
Remove dependency to opencv and rewrite headblur for pure pillow
Jul 7, 2023
0f93918
Remove dependency to opencv and rewrite headblur for pure pillow
Jul 7, 2023
155167f
Remove usseless libs
Jul 7, 2023
6e4e87f
rename ffmpeg previewers to ffplay
Jul 8, 2023
d72ac0c
Change gif encoding to use modern imageio pillow and remove useless args
Jul 9, 2023
3da8b0e
Rename ipython_display to display_in_notebook
Jul 11, 2023
ec3aa84
Change doc theme to pydata
Jul 11, 2023
3545f8d
Start transition of effect from function to real class, video effects…
Jul 13, 2023
c0c2f6b
Continue transition of effect from function to method. All audio effe…
Jul 13, 2023
22ff2e2
Continue transition of effect from function to method. Transitions ar…
Jul 13, 2023
9e40c16
Finish migration of effects to class by updating auto-adding of effec…
Jul 13, 2023
f637b6a
Move from with_effect to with_effects
Jul 14, 2023
49a9023
Add shortcut for Resize, Rotate, Crop, MultiplyVolume and MultiplySpe…
Jul 15, 2023
e25729a
Fix invalid call to audio.preview instead of audio.audiopreview
Jul 18, 2023
3a2e071
Fixing improper video preview and show for composite video clip with …
Jul 20, 2023
b8553d6
Update doc
Jul 21, 2023
4f3bfbf
Remove auto adding of effects as clip methods at runtime
Jul 22, 2023
502e61b
update some doc
Jul 22, 2023
2153fd8
Refactor doc + add media for testing and doc + some polishing
Jul 25, 2023
5f57894
Validate test PR + fix subtitcles clip
Jul 25, 2023
856a7a9
Fix tests on textclip
Jul 25, 2023
ca9f48f
add doc for matmul and and operator + enforce typing of frame in clip…
Jul 25, 2023
dce5423
Fix tests on videoclip
Jul 25, 2023
27edd7b
update to laczos instead of antialias in pillow resize
Jul 26, 2023
e717320
fix test compositing
Jul 26, 2023
82b969a
update gif writer with imageio to v3 + fix gif framerate
Jul 26, 2023
50adf08
Fix tests on ffmpeg_writer
Jul 26, 2023
3bd501b
remove now useless test_examples
Jul 26, 2023
41810e2
Fix method resize + fix default expand for rotate
Jul 26, 2023
549978e
Fix bad time conversion for end_time
Jul 26, 2023
a2bcd60
add doc
Jul 26, 2023
8be5cc9
all test on fx working
Jul 26, 2023
e010536
fix tests issues
Jul 26, 2023
76993b7
fix tests on tools
Jul 26, 2023
81c2941
Use v2 imageio read for images to make gif works
Jul 26, 2023
b9d22bb
Fix videotools tests, we shall add back ipython tests later
Jul 26, 2023
35e9c7e
remove debug print + improve doc for subtitles
Jul 26, 2023
6311c4a
Fix test subtitles
Jul 26, 2023
45740d4
No need to test editor anymore
Jul 26, 2023
aa52738
Use imageio.v2 imread
Jul 27, 2023
9713a72
add param is_mask to videofileclip and auto calculate image sequence fps
Jul 27, 2023
507d173
add tests for doc examples
Jul 28, 2023
e0675c8
Use shorter media for doc testing
Jul 28, 2023
b6d4c31
Update doc code examples
Jul 28, 2023
2f6ad0d
update pre-commit, block and flake8
Jul 28, 2023
e8c50af
Make tests name for doc example more readable
Jul 28, 2023
b434d2e
fix few examples
Jul 28, 2023
59e0f8b
Apply black formatting
Jul 28, 2023
d75eb56
Use latest version of numpy
Jul 28, 2023
feda255
Fix importing version break install
Jul 28, 2023
92603ee
Remove tests with graphical interface when no gui available
Jul 29, 2023
41fdf1d
Remove tests with graphical interface when no gui available
Jul 29, 2023
82b1700
Remove tests with graphical interface when no gui available
Jul 29, 2023
73d93a2
Update Docker and the doc relative to docker usage
Jul 29, 2023
c47f334
add github link to doc menu
Jul 30, 2023
242074a
add info for migrating from v1 to v2
Jul 30, 2023
f6e467f
Remove useless test, format doc examples, add doc for dev guide, upda…
Jul 31, 2023
f72f758
add warning about breaking change with v2
Jul 31, 2023
fc6e11e
fix notice format
Jul 31, 2023
6f62c3a
change readme from rst to md
Jul 31, 2023
b95501a
improve format readme
Jul 31, 2023
d67956c
improve format readme
Jul 31, 2023
380d97b
Remove imagemagick from ci
Jul 31, 2023
ed18e81
remove old resize
Jul 31, 2023
76e948b
Rename readme.rst -> .md + fix missing line return in doc
Aug 1, 2023
218930c
Try automagical improving og doc grammar and expression through chatgpt
Aug 1, 2023
43089d4
fix title length
Aug 1, 2023
455865d
Add margin parameter to textclip
Aug 2, 2023
5241db7
Update docs/conf.py
OsaAjani Mar 6, 2024
d3aed0c
Update docs/_static/code/user_guide/compositing/juxtaposing.py
OsaAjani Mar 6, 2024
3f58b23
Add long_description_content_type
Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 0 additions & 39 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
echo $PYTHONHOME
- name: Install dependencies
run: |
brew install imagemagick
# needed for installing matplotlib
brew install pkg-config
python -m pip install --upgrade wheel setuptools coveralls
Expand Down Expand Up @@ -62,38 +61,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Get ImageMagick installer from cache
id: imagemagick-installer-cache
uses: actions/cache@v3
with:
path: |
ImageMagick.exe
key: ${{ runner.os }}-latest

- name: Download ImageMagick installer
shell: cmd
if: steps.imagemagick-installer-cache.outputs.cache-hit != 'true'
run: |
python3 scripts/get-latest-imagemagick-win.py >im-url.txt
set /p IMAGEMAGICK_URL= <im-url.txt
rm im-url.txt
echo %IMAGEMAGICK_URL%
curl %IMAGEMAGICK_URL% -o ImageMagick.exe

- name: Install ImageMagick
id: imagemagick-install
shell: cmd
run: |
set IMAGEMAGICK_INSTALL_DIR=%CD%\imagemagick
mkdir %IMAGEMAGICK_INSTALL_DIR%
echo %IMAGEMAGICK_INSTALL_DIR%

ImageMagick.exe /SILENT /SP /DIR=%IMAGEMAGICK_INSTALL_DIR%
dir imagemagick

move imagemagick\ffmpeg.exe ffmpeg.exe
move imagemagick\magick.exe convert.exe

- name: Install Python dependencies
run: |
python -m pip install --upgrade wheel setuptools coveralls
Expand Down Expand Up @@ -148,12 +115,6 @@ jobs:
run: |
python -m pip install ".[test, optional, doc]"

- name: Configure ImageMagick policy
run: |
cat /etc/ImageMagick-6/policy.xml \
| sed 's/none/read,write/g' \
| sudo tee /etc/ImageMagick-6/policy.xml

- name: PyTest
run: |
python -m pytest --doctest-glob "moviepy/**/**.py" --cov moviepy --cov-report term-missing
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.7.0
hooks:
- id: black
language_version: python3.6
language_version: python3
files: \.py$
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
args:
- '--filter-files'
files: \.py$
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-absolute-import>=1.0
- flake8-docstrings>=1.6.0
- flake8-rst-docstrings>=0.2.5
- flake8-implicit-str-concat==0.3.0
- flake8-docstrings>=1.7.0
- flake8-rst-docstrings>=0.3
- flake8-implicit-str-concat==0.4.0
name: flake8-test
files: \.py$
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3

# Install numpy using system package manager
RUN apt-get -y update && apt-get -y install ffmpeg imagemagick
# Install ffmpeg to get ffplay using system package manager
RUN apt-get -y update && apt-get -y install ffmpeg

# Install some special fonts we use in testing, etc..
RUN apt-get -y install fonts-liberation
Expand All @@ -12,9 +12,9 @@ RUN apt-get install -y locales && \

ENV LC_ALL C.UTF-8

ADD . /var/src/moviepy/
#RUN git clone https://github.com/Zulko/moviepy.git /var/src/moviepy
RUN cd /var/src/moviepy/ && pip install .[optional]
# Update pip
RUN pip install --upgrade pip

ADD . /moviepy
RUN cd /moviepy && pip install . && pip install .[test] && pip install .[doc] && pip install .[lint]

# modify ImageMagick policy file so that Textclips work correctly.
RUN sed -i 's/none/read,write/g' /etc/ImageMagick-6/policy.xml
114 changes: 114 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# MoviePy


[![MoviePy page on the Python Package Index](https://badge.fury.io/py/moviepy.svg)](PyPI_) [![Discuss MoviePy on Gitter](https://img.shields.io/gitter/room/movie-py/gitter?color=46BC99&logo=gitter)](Gitter_) [![Build status on gh-actions](https://img.shields.io/github/actions/workflow/status/Zulko/moviepy/test_suite.yml?logo=github)](https://github.com/Zulko/moviepy/actions/workflows/test_suite.yml) [![Code coverage from coveralls.io](https://img.shields.io/coveralls/github/Zulko/moviepy/master?logo=coveralls)](https://coveralls.io/github/Zulko/moviepy?branch=master)

> [!NOTE]
> MoviePy recently upgraded to v2.0, introducing major
breaking changes, for more info, see [the updating
guide](https://zulko.github.io/moviepy/getting_started/updating_to_v2.html).

MoviePy (full [documentation](https://zulko.github.io/moviepy/)) 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:

``` python
# 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](https://zulko.github.io/moviepy/getting_started/install.html).

For contributors installation, see
[documentation_dev_install](https://zulko.github.io/moviepy/developer_guide/developers_install.rst).

# Documentation

Building the documentation has additional dependencies that require
installation.

``` bash
$ (sudo) pip install moviepy[doc]
```

The documentation can be generated and viewed via:

``` bash
$ python setup.py build_docs
```

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

``` bash
$ python setup.py build_docs -E
```

More information is available from the
[Sphinx](https://www.sphinx-doc.org/en/master/setuptools.html)
documentation.

# Contribute

MoviePy is open-source software originally written by
[Zulko](https://github.com/Zulko) and released under the MIT licence.
The project is hosted on [GitHub](https://github.com/Zulko/moviepy),
where everyone is welcome to contribute, ask for help or simply give
feedback. Please read our [Contributing
Guidelines](https://github.com/Zulko/moviepy/blob/master/CONTRIBUTING.md)
for more information about how to contribute!

You can also discuss the project on
[Reddit](https://www.reddit.com/r/moviepy/) or
[Gitter](https://gitter.im/movie-py/Lobby). These are preferred over
GitHub issues for usage questions and examples.

# Maintainers

- [Zulko](https://github.com/Zulko) (owner)
- [@tburrows13](https://github.com/tburrows13)
- [@mgaitan](https://github.com/mgaitan)
- [@earney](https://github.com/earney)
- [@mbeacom](https://github.com/mbeacom)
- [@overdrivr](https://github.com/overdrivr)
- [@keikoro](https://github.com/keikoro)
- [@ryanfox](https://github.com/ryanfox)
- [@mondeja](https://github.com/mondeja)
Loading