Skip to content

Commit

Permalink
fixing checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Zulko committed Nov 24, 2024
1 parent 9ae3250 commit de14ce5
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from moviepy import VideoFileClip, CompositeVideoClip

# We load all the clips we want to compose
clip1 = VideoFileClip("some_background.mp4")
clip2 = VideoFileClip("some_video.mp4").subclipped(0, 1)
clip3 = VideoFileClip("some_moving_text.mp4")
clip1 = VideoFileClip("example.mp4")
clip2 = VideoFileClip("example2.mp4").subclipped(0, 1)
clip3 = VideoFileClip("example.mp4")

# We concatenate them and write theme stacked on top of each other,
# with clip3 over clip2 over clip1
Expand Down
6 changes: 3 additions & 3 deletions docs/_static/code/user_guide/compositing/concatenate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from moviepy import VideoFileClip, concatenate_videoclips

# We load all the clips we want to concatenate
clip1 = VideoFileClip("first_scene.mp4")
clip2 = VideoFileClip("second_scene.mp4").subclipped(0, 1)
clip3 = VideoFileClip("third_scene.mp4")
clip1 = VideoFileClip("example.mp4")
clip2 = VideoFileClip("example2.mp4").subclipped(0, 1)
clip3 = VideoFileClip("example3.mp4")

# We concatenate them and write the result
final_clip = concatenate_videoclips([clip1, clip2, clip3])
Expand Down
15 changes: 8 additions & 7 deletions moviepy/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def convert_to_seconds(time):
convert_to_seconds('1:33,5') # only minutes and secs
99.5
convert_to_seconds('33.5') # only secs
33.5
33.5
"""
factors = (1, 60, 3600)

Expand Down Expand Up @@ -103,12 +103,13 @@ def deprecated_version_of(func, old_name):
Examples
--------
>>> # The badly named method 'to_file' is replaced by 'write_file'
>>> class Clip:
>>> def write_file(self, some args):
>>> # blablabla
>>>
>>> Clip.to_file = deprecated_version_of(Clip.write_file, 'to_file')
.. code:: python
# The badly named method 'to_file' is replaced by 'write_file'
class Clip:
def write_file(self, some args):
# blablabla
Clip.to_file = deprecated_version_of(Clip.write_file, 'to_file')
"""
# Detect new name of func
new_name = func.__name__
Expand Down
2 changes: 1 addition & 1 deletion moviepy/video/fx/MasksAnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MasksAnd(Effect):
mask = ColorClip(color=(0, 255, 0), size=(1, 1)) # green
masked_clip = clip.with_effects([vfx.MasksAnd(mask)]) # black
masked_clip.get_frame(0)
[[[0 0 0]]]
[[[0 0 0]]]
"""

other_clip: Union[Clip, np.ndarray]
Expand Down
2 changes: 1 addition & 1 deletion moviepy/video/fx/MasksOr.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MasksOr(Effect):
mask = ColorClip(color=(0, 255, 0), size=(1, 1)) # green
masked_clip = clip.with_effects([vfx.MasksOr(mask)]) # yellow
masked_clip.get_frame(0)
[[[255 255 0]]]
[[[255 255 0]]]
"""

other_clip: Union[Clip, np.ndarray]
Expand Down
1 change: 0 additions & 1 deletion moviepy/video/io/VideoFileClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class VideoFileClip(VideoClip):
If copies are made, and close() is called on one, it may cause methods on
the other copies to fail.
"""

@convert_path_to_string("filename")
Expand Down
2 changes: 1 addition & 1 deletion moviepy/video/tools/cuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def find_video_period(clip, fps=None, start_time=0.3):
clip = VideoFileClip("media/chaplin.mp4").subclipped(0, 1).loop(2)
round(videotools.find_video_period(clip, fps=80), 6)
1
1
"""

def frame(t):
Expand Down
4 changes: 3 additions & 1 deletion moviepy/video/tools/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ def color_gradient(
color_gradient((10, 1), (0, 0), p2=(10, 0)) # from white to black
#[[1. 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1]]
# from red to green
color_gradient((10, 1), (0, 0), p2=(10, 0), color_1=(255, 0, 0), color_2=(0, 255, 0))
color_gradient(
(10, 1), (0, 0), p2=(10, 0), color_1=(255, 0, 0), color_2=(0, 255, 0)
)
# [[[ 0. 255. 0. ]
# [ 25.5 229.5 0. ]
# [ 51. 204. 0. ]
Expand Down

0 comments on commit de14ce5

Please sign in to comment.