From 35ead0970195d56d40cdf171ec6437ce2e068a1a Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Wed, 13 May 2020 15:04:01 -0400 Subject: [PATCH 1/2] FIX: Fix for FFMpeg + GIF --- lib/matplotlib/animation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 3f3e62490d93..0e5383bf05cf 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -570,7 +570,9 @@ class FFMpegBase: @property def output_args(self): - args = ['-vcodec', self.codec] + args = [] + if not self.outfile.endswith('.gif'): + args.extend(['-vcodec', self.codec]) extra_args = (self.extra_args if self.extra_args is not None else mpl.rcParams[self._args_key]) # For h264, the default format is yuv444p, which is not compatible From 198246932f4e3b5195bd565a46a34c8e066875fc Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Wed, 13 May 2020 21:37:10 -0400 Subject: [PATCH 2/2] Update lib/matplotlib/animation.py Co-authored-by: Thomas A Caswell --- 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 0e5383bf05cf..6ef1a04d7f35 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -571,7 +571,7 @@ class FFMpegBase: @property def output_args(self): args = [] - if not self.outfile.endswith('.gif'): + if not Path(self.outfile).suffix == '.gif': args.extend(['-vcodec', self.codec]) extra_args = (self.extra_args if self.extra_args is not None else mpl.rcParams[self._args_key])