Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 755fc9e

Browse files
committed
Copy logging setup from FFMpegWriter to FFMpegFileWriter.
1 parent a02ffbc commit 755fc9e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/animation.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,15 @@ class FFMpegFileWriter(FFMpegBase, FileMovieWriter):
634634
def _args(self):
635635
# Returns the command line parameters for subprocess to use
636636
# ffmpeg to create a movie using a collection of temp images
637-
return [self.bin_path(), '-r', str(self.fps),
637+
args = [self.bin_path(), '-r', str(self.fps),
638638
'-i', self._base_temp_name(),
639-
'-vframes', str(self._frame_counter)] + self.output_args
639+
'-vframes', str(self._frame_counter)]
640+
# Logging is quieted because subprocess.PIPE has limited buffer size.
641+
# If you have a lot of frames in your animation and set logging to
642+
# DEBUG, you will have a buffer overrun.
643+
if _log.getEffectiveLevel() > logging.DEBUG:
644+
args += ['-loglevel', 'error']
645+
return [*args, *self.output_args]
640646

641647

642648
# Base class of avconv information. AVConv has identical arguments to FFMpeg.

0 commit comments

Comments
 (0)