Moviepy still prints a progress bar even after setting `verbose` to `False`

Question:

I tried to suppress the console output produced from moviepy when calling the “write_videofile” method.
I passed the verbose argument as False to no avail.
It still outputs something like:

0%| | 0/1624 [00:00<?, ?it/s]
0%| | 8/1624 [00:00<00:20, 77.64it/s]
1%| | 16/1624 [00:00<00:20, 78.31it/s]
2%|1 | 25/1624 [00:00<00:20, 77.90it/s]
2%|2 | 34/1624 [00:00<00:19, 80.80it/s]
3%|2 | 42/1624 [00:00<00:20, 75.91it/s]
3%|3 | 51/1624 [00:00<00:20, 76.07it/s]
4%|3 | 58/1624 [00:00<00:25, 62.44it/s]
4%|4 | 65/1624 [00:00<00:28, 54.77it/s]
4%|4 | 71/1624 [00:01<00:28, 53.63it/s]
5%|4 | 77/1624 [00:01<00:29, 52.69it/s]
5%|5 | 83/1624 [00:01<00:28, 54.06it/s]
5%|5 | 89/1624 [00:01<00:29, 52.80it/s]
6%|5 | 96/1624 [00:01<00:26, 56.95it/s]
6%|6 | 102/1624 [00:01<00:29, 52.38it/s]
7%|6 | 108/1624 [00:01<00:29, 51.74it/s]
...
...
...
100%|#########9| 1621/1624 [00:28<00:00, 51.43it/s]
100%|##########| 1624/1624 [00:28<00:00, 57.75it/s]

Is there any way to suppress completely the output?

Asked By: user734094

||

Answers:

Update – This answer is now out-of-date. Use logger=None, or set logger to a custom subclass of a Proglog logger for more fine-grained control.


Yes.

There is parameter in write_vidiofile and write_audiofile called progress_bar. Pass progress_bar=False to remove the progress bar. Usually you’ll also want to pass verbose=False as well, like you have.

In order to get this functionality, you’ll probably have to run pip install moviepy --upgrade (swap pip for pip3 if using Python 3), as this has only just been added (Added in moviepy version 0.2.3.1).

The full usage is this:

clip = VideoFileClip("video.mp4")  # Generate a clip
clip.write_videofile("output.mp4")  # Prints progress bar and info
clip.write_videofile("output.mp4", verbose=False)  # Just prints progress bar
clip.write_videofile("output.mp4", verbose=False, progress_bar=False)  # Prints nothing

A progress_bar parameter should also be coming to write_images_sequence, we’re currently aiming for version 0.2.3.2.

Answered By: Tom Burrows

Now in 2019 you have to use clip.write_videofile("output.mp4", verbose=False, logger=None) to hide progress bar, using progress_bar=True got an error like: TypeError: write_audiofile() got an unexpected keyword argument 'progress_bar'

Answered By: Lorenzo Morelli

Calling help(clip.write_videofile) shows that:

verbose (deprecated, kept for compatibility)
Formerly used for toggling messages on/off. Use logger=None now.

So you have to set the parameter logger=None.

Answered By: roschach

For moviepy==1.0.3

use

logger=None
Answered By: Nabin Bhusal

Now in Moviepy version 1.0.3 its as follows:

video.audio.write_audiofile(audio_file_path.wav, verbose= False, logger= None)

progress_bar is changed to logger.
Just set it to None if you don’t want progress bar.

Answered By: Shubham Tomar

To disable the progress bar or any other message from moviepy to appear make sure to set

Logger to None

write_videofile(self, filename, logger=None)
Answered By: arorakaran19
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.