From 1935f1273aef443895a4da4e5f2c4aa86103a414 Mon Sep 17 00:00:00 2001 From: Vlad Seghete Date: Mon, 25 Nov 2013 13:35:57 -0600 Subject: [PATCH 1/3] fixes issue #2482 and adds note about incompatibility between bbox options and animation backends --- lib/matplotlib/animation.py | 8 ++++---- matplotlibrc.template | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 295d60d8501f..9078c5d1c343 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -399,9 +399,9 @@ class FFMpegFileWriter(FileMovieWriter, FFMpegBase): def _args(self): # Returns the command line parameters for subprocess to use # ffmpeg to create a movie using a collection of temp images - return [self.bin_path(), '-vframes', str(self._frame_counter), - '-r', str(self.fps), '-i', - self._base_temp_name()] + self.output_args + return [self.bin_path(), '-i', self._base_temp_name()-vframes, + '-vframes', str(self._frame_counter), + '-r', str(self.fps), ] + self.output_args # Base class of avconv information. AVConv has identical arguments to @@ -1002,7 +1002,7 @@ def __init__(self, fig, func, frames=None, init_func=None, fargs=None, self._iter_gen = lambda: iter(frames) self.save_count = len(frames) else: - self._iter_gen = lambda: xrange(frames) + self._iter_gen = lambda: xrange(frames).__iter__() self.save_count = frames # If we're passed in and using the default, set it to 100. diff --git a/matplotlibrc.template b/matplotlibrc.template index 473d62424f9c..e4d35934c5fb 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -380,6 +380,10 @@ backend : %(backend)s #savefig.edgecolor : white # figure edgecolor when saving #savefig.format : png # png, ps, pdf, svg #savefig.bbox : standard # 'tight' or 'standard'. + # 'tight' is incompatible with pipe-based animation + # backends but will workd with temporary file based ones: + # e.g. setting animation.writer to ffmpeg will not work, + # use ffmpeg_file instead #savefig.pad_inches : 0.1 # Padding to be used when bbox is set to 'tight' #savefig.jpeg_quality: 95 # when a jpeg is saved, the default quality parameter. #savefig.directory : ~ # default directory in savefig dialog box, From f38fcb392d1d247b933f00e65022892007fb8325 Mon Sep 17 00:00:00 2001 From: Vlad Seghete Date: Mon, 25 Nov 2013 13:52:53 -0600 Subject: [PATCH 2/3] fixed a typo --- lib/matplotlib/animation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 9078c5d1c343..07c6d2735356 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -399,7 +399,7 @@ class FFMpegFileWriter(FileMovieWriter, FFMpegBase): def _args(self): # Returns the command line parameters for subprocess to use # ffmpeg to create a movie using a collection of temp images - return [self.bin_path(), '-i', self._base_temp_name()-vframes, + return [self.bin_path(), '-i', self._base_temp_name(), '-vframes', str(self._frame_counter), '-r', str(self.fps), ] + self.output_args From 5c8f3d605ff045ddfbc3ca950aef85366617af5a Mon Sep 17 00:00:00 2001 From: Vlad Seghete Date: Mon, 25 Nov 2013 14:17:54 -0600 Subject: [PATCH 3/3] fixed another typo --- lib/matplotlib/animation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 07c6d2735356..9854ca2527f6 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -401,7 +401,7 @@ def _args(self): # ffmpeg to create a movie using a collection of temp images return [self.bin_path(), '-i', self._base_temp_name(), '-vframes', str(self._frame_counter), - '-r', str(self.fps), ] + self.output_args + '-r', str(self.fps)] + self.output_args # Base class of avconv information. AVConv has identical arguments to