Skip to content

Video editing with Python

Add progress_bar option to write_images_sequence

Achal Dave0190bea6aab0
diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.py
index bcc6bb2b..7c10f7f4 100644
--- a/moviepy/video/VideoClip.py
+++ b/moviepy/video/VideoClip.py
@@ -347,7 +347,7 @@ class VideoClip(Clip):
@use_clip_fps_by_default
@convert_masks_to_RGB
def write_images_sequence(self, nameformat, fps=None, verbose=True,
- withmask=True):
+ withmask=True, progress_bar=True):
""" Writes the videoclip to a sequence of image files.
@@ -371,6 +371,9 @@ class VideoClip(Clip):
verbose
Verbose output ?
+ progress_bar
+ Boolean indicating whether to show the progress bar.
+
Returns
--------
@@ -392,7 +395,7 @@ class VideoClip(Clip):
filenames = []
total = int(self.duration / fps) + 1
- for i, t in tqdm(enumerate(tt), total=total):
+ for i, t in tqdm(enumerate(tt), total=total, disable=not progress_bar):
name = nameformat % i
filenames.append(name)
self.save_frame(name, t, withmask=withmask)