Skip to content

Commit 2b23fee

Browse files
committed
Don't pass vframes to ffmpeg when using a tmpdir
Also, switch to the not-deprecated `frames:v`.
1 parent 43ebfa2 commit 2b23fee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/animation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,9 @@ def _args(self):
591591
'-video_size', '%dx%d' % self.frame_size,
592592
'-pixel_format', 'rgba',
593593
]
594-
args += ['-framerate', str(self.fps), '-i', self._base_temp_name(),
595-
'-vframes', str(self._frame_counter)]
594+
args += ['-framerate', str(self.fps), '-i', self._base_temp_name()]
595+
if not self._tmpdir:
596+
args += ['-frames:v', str(self._frame_counter)]
596597
# Logging is quieted because subprocess.PIPE has limited buffer size.
597598
# If you have a lot of frames in your animation and set logging to
598599
# DEBUG, you will have a buffer overrun.

0 commit comments

Comments
 (0)