8000 Fix subprocess bug when saving animations. · matplotlib/matplotlib@66b14f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 66b14f1

Browse files
committed
Fix subprocess bug when saving animations.
Ffmpeg prints a lot of info to stderr. For longer animations, this logging fills up the (very-small) buffer for subprocess.PIPE and subprocess just hangs (no error). Suppress logging in ffmpeg to prevent this issue.
1 parent 5b90a27 commit 66b14f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/matplotlib/animation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,12 @@ def output_args(self):
356356
class FFMpegWriter(MovieWriter, FFMpegBase):
357357
def _args(self):
358358
# Returns the command line parameters for subprocess to use
359-
# ffmpeg to create a movie using a pipe
359+
# ffmpeg to create a movie using a pipe.
360+
# Logging is quieted because subprocess.PIPE has limited buffer size.
360361
return [self.bin_path(), '-f', 'rawvideo', '-vcodec', 'rawvideo',
361-
'-s', '%dx%d' % self.frame_size, '-pix_fmt', self.frame_format,
362-
'-r', str(self.fps), '-i', 'pipe:'] + self.output_args
362+
'-s', '%dx%d' % self.frame_size, '-pix_fmt', self.frame_format,
363+
'-r', str(self.fps), '-loglevel', 'quiet',
364+
'-i', 'pipe:'] + self.output_args
363365

364366

365367
#Combine FFMpeg options with temp file-based writing

0 commit comments

Comments
 (0)
0