Video editing with Python
remove debug print + improve doc for subtitles
osaajani35e9c7e5c86f
diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.pyindex 1c97d95e..52c162fd 100644--- a/moviepy/video/VideoClip.py+++ b/moviepy/video/VideoClip.py@@ -1191,8 +1191,6 @@ 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 diskimg = imread_v2(img) # We use v2 imread cause v3 fail with gif@@ -1492,6 +1490,7 @@ class TextClip(ImageClip):return min_font_size - 1try :+ print("f", font)_ = ImageFont.truetype(font)except Exception as e :raise ValueError("Invalid font {}, pillow failed to use it with error {}".format(font, e))diff --git a/moviepy/video/fx/Rotate.py b/moviepy/video/fx/Rotate.pyindex 29ea5939..9cba4135 100644--- a/moviepy/video/fx/Rotate.py+++ b/moviepy/video/fx/Rotate.py@@ -86,7 +86,6 @@ class Rotate(Effect) :if (angle == 0) and self.expand:return imif (angle == 90) and self.expand:- print('qaq')transpose = [1, 0] if len(im.shape) == 2 else [1, 0, 2]return np.transpose(im, axes=transpose)[::-1]elif (angle == 270) and self.expand:diff --git a/moviepy/video/io/ffmpeg_writer.py b/moviepy/video/io/ffmpeg_writer.pyindex f53df14d..cbae415a 100644--- a/moviepy/video/io/ffmpeg_writer.py+++ b/moviepy/video/io/ffmpeg_writer.py@@ -133,8 +133,6 @@ class FFMPEG_VideoWriter:cmd.extend(["-pix_fmt", "yuv420p"])cmd.extend([filename])- print(' '.join(cmd))-popen_params = cross_platform_popen_params({"stdout": sp.DEVNULL, "stderr": logfile, "stdin": sp.PIPE})diff --git a/moviepy/video/tools/cuts.py b/moviepy/video/tools/cuts.pyindex 6d09979f..27873fda 100644--- a/moviepy/video/tools/cuts.py+++ b/moviepy/video/tools/cuts.py@@ -343,12 +343,12 @@ class FramesMatches(list):>>> from moviepy.video.tools.cuts import FramesMatches>>>>>> ch_clip = VideoFileClip("media/chaplin.mp4").with_subclip(1, 4)- >>> clip = concatenate_videoclips([ch_clip.time_mirror(), ch_clip])+ >>> clip = concatenate_videoclips([ch_clip.with_effects([vfx.TimeMirror()]), ch_clip])>>>>>> result = FramesMatches.from_clip(clip, 10, 3).select_scenes(... 1, 2, nomatch_threshold=0,... )- >>> pprint(result)+ >>> print(result)[(1.0000, 4.0000, 0.0000, 0.0000),(1.1600, 3.8400, 0.0000, 0.0000),(1.2800, 3.7200, 0.0000, 0.0000),diff --git a/moviepy/video/tools/subtitles.py b/moviepy/video/tools/subtitles.pyindex e0fd9f80..03c5e630 100644--- a/moviepy/video/tools/subtitles.py+++ b/moviepy/video/tools/subtitles.py@@ -20,12 +20,22 @@ class SubtitlesClip(VideoClip):----------subtitles- Either the name of a file as a string or path-like object, or a list+ Either the name of a file as a string or path-like object, or a list++ font+ Path to a font file to be used. Optional if make_textclip is provided.++ make_textclip+ A custom function to use for text clip generation. If None, a TextClip+ will be generated.++ The function must take a text as argument and return a VideoClip+ to be used as captionencoding- Optional, specifies srt file encoding.- Any standard Python encoding is allowed (listed at- https://docs.python.org/3.8/library/codecs.html#standard-encodings)+ Optional, specifies srt file encoding.+ Any standard Python encoding is allowed (listed at+ https://docs.python.org/3.8/library/codecs.html#standard-encodings)Examples--------