Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add progress_bar option to write_images_sequence #300

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions moviepy/video/VideoClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def write_videofile(self, filename, fps=None, codec=None,
@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.


Expand All @@ -371,6 +371,9 @@ def write_images_sequence(self, nameformat, fps=None, verbose=True,
verbose
Verbose output ?

progress_bar
Boolean indicating whether to show the progress bar.


Returns
--------
Expand All @@ -392,7 +395,7 @@ def write_images_sequence(self, nameformat, fps=None, verbose=True,

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)
Expand Down