Skip to content

Video editing with Python

Use v2 imageio read for images to make gif works

osaajani81c2941c7e57
diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.py
index c6697d44..1c97d95e 100644
--- a/moviepy/video/VideoClip.py
+++ b/moviepy/video/VideoClip.py
@@ -11,6 +11,7 @@ from numbers import Real
import numpy as np
import proglog
from imageio.v3 import imread, imwrite
+from imageio.v2 import imread as imread_v2
from PIL import Image, ImageDraw, ImageFont
import threading
@@ -1190,9 +1191,11 @@ class ImageClip(VideoClip):
):
VideoClip.__init__(self, is_mask=is_mask, duration=duration)
+ print(img)
+
if not isinstance(img, np.ndarray):
# img is a string or path-like object, so read it in from disk
- img = imread(img)
+ img = imread_v2(img) # We use v2 imread cause v3 fail with gif
if len(img.shape) == 3: # img is (now) a RGB(a) numpy array
if img.shape[2] == 4:
diff --git a/moviepy/video/tools/credits.py b/moviepy/video/tools/credits.py
index 9c356dfb..4ada625a 100644
--- a/moviepy/video/tools/credits.py
+++ b/moviepy/video/tools/credits.py
@@ -78,7 +78,6 @@ class CreditsClip(TextClip):
self,
creditfile,
width,
- stretch=30,
color="white",
stroke_color="black",
stroke_width=2,
@@ -114,15 +113,15 @@ class CreditsClip(TextClip):
# Make two columns for the credits
left, right = [
TextClip(
- txt,
+ text=txt,
color=color,
stroke_color=stroke_color,
stroke_width=stroke_width,
font=font,
font_size=font_size,
- align=align,
+ text_align=align,
)
- for txt, align in [(left, "East"), (right, "West")]
+ for txt, align in [(left, "left"), (right, "right")]
]
both_columns = CompositeVideoClip(