forked from Zulko/moviepy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Formalize flake8 linting (Zulko#1439)
* Fix flake8 errors (except complexity < 10 restriction) and configure from file * Lint tests; add 'flake8-implicit-str-concat'; add optional reqs 'lint' * Remove blank lines at the end of 'setup.cfg' * Refactor 'os' imports in 'tests/test_resourcerelease.py' * Fix new flake8 errors * Add linting and formatting instructions to README * Fix black dep version definition in setup * Convert relative imports into absolute ones; add relative imports linting * Fix error in lint dependency * Fix errors and improve flake8 config comments * Ignores rules in 'editor.py' using configuration * Removed uneeded '# -*- coding: utf-8 -*-' statements * Remove '__future__' imports * Minor changes
- Loading branch information
Showing
55 changed files
with
359 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Result: https://www.youtube.com/watch?v=Qu7HJrsEYFg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
# import every video fx function | ||
|
||
from .audio_fadein import audio_fadein | ||
from .audio_fadeout import audio_fadeout | ||
from .audio_normalize import audio_normalize | ||
from .multiply_stereo_volume import multiply_stereo_volume | ||
from .multiply_volume import multiply_volume | ||
from moviepy.audio.fx.audio_fadein import audio_fadein | ||
from moviepy.audio.fx.audio_fadeout import audio_fadeout | ||
from moviepy.audio.fx.audio_loop import audio_loop | ||
from moviepy.audio.fx.audio_normalize import audio_normalize | ||
from moviepy.audio.fx.multiply_stereo_volume import multiply_stereo_volume | ||
from moviepy.audio.fx.multiply_volume import multiply_volume | ||
|
||
__all__ = ( | ||
"audio_fadein", | ||
"audio_fadeout", | ||
"audio_left_right", | ||
"audio_loop", | ||
"audio_normalize", | ||
"multiply_stereo_volume", | ||
"multiply_volume", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
""" | ||
moviepy.audio.fx.all is deprecated. | ||
moviepy.audio.fx.all is deprecated. | ||
Use the fx method directly from the clip instance (e.g. ``clip.audio_normalize(...)``) | ||
or import the function from moviepy.audio.fx instead. | ||
or import the function from moviepy.audio.fx instead. | ||
""" | ||
import warnings | ||
|
||
from .. import * | ||
from .. import * # noqa 401,F403 | ||
|
||
warnings.warn(f"\nMoviePy: {__doc__}", UserWarning) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from moviepy.audio.AudioClip import concatenate_audioclips | ||
from moviepy.decorators import audio_video_fx | ||
|
||
|
||
@audio_video_fx | ||
def audio_loop(clip, n_loops=None, duration=None): | ||
"""Loops over an audio clip. | ||
Returns an audio clip that plays the given clip either | ||
`n_loops` times, or during `duration` seconds. | ||
Examples | ||
======== | ||
>>> from moviepy import * | ||
>>> videoclip = VideoFileClip('myvideo.mp4') | ||
>>> music = AudioFileClip('music.ogg') | ||
>>> audio = afx.audio_loop( music, duration=videoclip.duration) | ||
>>> videoclip.with_audio(audio) | ||
""" | ||
if duration is not None: | ||
n_loops = int(duration / clip.duration) + 1 | ||
return concatenate_audioclips(n_loops * [clip]).with_duration(duration) | ||
|
||
return concatenate_audioclips(n_loops * [clip]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import numpy as np | ||
|
||
from moviepy.decorators import audio_video_fx | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import os | ||
import subprocess as sp | ||
import warnings | ||
|
||
import proglog | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
""" | ||
import os | ||
import subprocess as sp | ||
import sys | ||
import warnings | ||
|
||
import proglog | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.