4

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?

Tom Burrows
  • 2,225
  • 2
  • 29
  • 46

6 Answers6

13

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'

Lorenzo Morelli
  • 430
  • 4
  • 8
  • _Still in 2019_. Interestingly, the function `write_videofile` actually takes `progress_bar` parameter https://zulko.github.io/moviepy/_modules/moviepy/video/VideoClip.html#VideoClip.write_videofile – ruX Mar 09 '19 at 09:58
  • 3
    Yes but, at least to me, that give an error, I solve that setting `logger=none` – Lorenzo Morelli Mar 14 '19 at 16:44
  • `verbose` is not used anymore, it is all included in the `logger` parameter. – Tom Burrows Jul 08 '20 at 09:23
7

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.

Tom Burrows
  • 2,225
  • 2
  • 29
  • 46
  • I accept the answer, but now I'm getting a lot of warning like: `[WARNING] 2017-03-10T08:49:57.111Z 6ea1aca8-056e-11e7-bea1-ad162b1b8df2 /var/task/moviepy/video/io/ffmpeg_reader.py:113: UserWarning: Warning: in file /tmp/49502576-b270-4935-b087-26f4c08bffed/1.mp4, 1166400 bytes wanted but 0 bytes read,at frame 705/712, at time 23.50/23.70 sec. Using the last valid frame instead. UserWarning)` –  Mar 10 '17 at 08:53
  • @anarchos78 Post that as an issue on GitHub, along with the code (and preferably the the video) that creates it. If it only appears when using `progress_bar=False` make sure to put that as well. – Tom Burrows Mar 10 '17 at 09:44
  • This has now been added to the released on PyPI version, so just running in the command line `pip install moviepy --upgrade` will add the `progress_bar` parameter to `write_videofile`. – Tom Burrows Apr 05 '17 at 16:37
  • @anarchos78, that error should be fixed as of the latest moviepy update. Please let us know if that is the case! – Tom Burrows Apr 05 '17 at 16:40
  • Is it just me, or is there no way to disable the progress bar for ImageSequenceClip.write_gif? – eric.mitchell Jul 20 '18 at 17:34
2

For moviepy==1.0.3

use

logger=None
Nabin Bhusal
  • 129
  • 1
  • 2
  • 7
2

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)
0

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.

roschach
  • 8,390
  • 14
  • 74
  • 124
0

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.

Shubham Tomar
  • 166
  • 1
  • 9