Skip to content

Commit 43ebfa2

Browse files
committed
Use -framerate to set ffmpeg input framerate
This is about the input frame rate, and as noted in ffmpeg docs, should be preferred over `-r` for input.
1 parent 690884f commit 43ebfa2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/matplotlib/animation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def _args(self):
559559
# ffmpeg to create a movie using a pipe.
560560
args = [self.bin_path(), '-f', 'rawvideo', '-vcodec', 'rawvideo',
561561
'-s', '%dx%d' % self.frame_size, '-pix_fmt', self.frame_format,
562-
'-r', str(self.fps)]
562+
'-framerate', str(self.fps)]
563563
# Logging is quieted because subprocess.PIPE has limited buffer size.
564564
# If you have a lot of frames in your animation and set logging to
565565
# DEBUG, you will have a buffer overrun.
@@ -590,9 +590,8 @@ def _args(self):
590590
'-f', 'image2', '-vcodec', 'rawvideo',
591591
'-video_size', '%dx%d' % self.frame_size,
592592
'-pixel_format', 'rgba',
593-
'-framerate', str(self.fps),
594593
]
595-
args += ['-r', str(self.fps), '-i', self._base_temp_name(),
594+
args += ['-framerate', str(self.fps), '-i', self._base_temp_name(),
596595
'-vframes', str(self._frame_counter)]
597596
# Logging is quieted because subprocess.PIPE has limited buffer size.
598597
# If you have a lot of frames in your animation and set logging to

0 commit comments

Comments
 (0)