Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed6a250

Browse filesBrowse files
committed
Pass number of frames for file-based writers.
By passing the number of frames, we elminate the possibility of including stale frames in animations.
1 parent 1f25dcc commit ed6a250
Copy full SHA for ed6a250

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Open diff view settings
Collapse file

‎lib/matplotlib/animation.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/animation.py
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,9 @@ class FFMpegFileWriter(FileMovieWriter, FFMpegBase):
379379
def _args(self):
380380
# Returns the command line parameters for subprocess to use
381381
# ffmpeg to create a movie using a collection of temp images
382-
return [self.bin_path(), '-r', str(self.fps), '-i',
383-
self._base_temp_name()] + self.output_args
382+
return [self.bin_path(), '-vframes', str(self._frame_counter),
383+
'-r', str(self.fps), '-i',
384+
self._base_temp_name()] + self.output_args
384385

385386

386387
# Base class of mencoder information. Contains configuration key information
@@ -435,7 +436,8 @@ def _args(self):
435436
# Returns the command line parameters for subprocess to use
436437
# mencoder to create a movie
437438
return [self.bin_path(),
438-
'mf://%s*.%s' % (self.temp_prefix, self.frame_format), '-mf',
439+
'mf://%s*.%s' % (self.temp_prefix, self.frame_format),
440+
'-frames', str(self._frame_counter), '-mf',
439441
'type=%s:fps=%d' % (self.frame_format, self.fps)] + self.output_args
440442

441443

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.