Skip to content

Commit

Permalink
Merge pull request #2244 from Zulko/OsaAjani-master
Browse files Browse the repository at this point in the history
Osa-ajani v2 master with conflicts resolutions
  • Loading branch information
Zulko authored Nov 20, 2024
2 parents 0f6f6d4 + 0201fec commit 458b36a
Show file tree
Hide file tree
Showing 507 changed files with 10,357 additions and 7,482 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/formatting_linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Show Flake8 version
run: flake8 --version
- name: Run Flake8
run: flake8 -v --show-source moviepy setup.py scripts docs/conf.py examples tests
run: flake8 -v --show-source moviepy setup.py docs/conf.py examples tests

isort:
name: isort import sorter
Expand Down
47 changes: 4 additions & 43 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ on:
jobs:
# Uses Python Framework build because on macOS, Matplotlib requires it
macos:
runs-on: macos-latest
runs-on: macos-12
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/[email protected]
- uses: s-weigand/[email protected]
Expand All @@ -37,7 +37,6 @@ jobs:
- name: Install dependencies
run: |
brew install imagemagick
# needed for installing matplotlib
brew install pkg-config
python -m pip install --upgrade wheel setuptools coveralls
Expand All @@ -58,7 +57,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false
steps:
- uses: actions/[email protected]
Expand All @@ -67,38 +66,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Get ImageMagick installer from cache
id: imagemagick-installer-cache
uses: actions/[email protected]
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 All @@ -123,7 +90,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false
steps:
- uses: actions/[email protected]
Expand Down Expand Up @@ -154,12 +121,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

0 comments on commit 458b36a

Please sign in to comment.