From 39d481dd5a47d4552100e505be6f0f4c8a5f78f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20Gouzien?= Date: Sat, 10 Jun 2017 18:36:09 +0200 Subject: [PATCH 1/2] Fix 'animation' unable to detect AVConv ; bug introduced in 926a59fdb9cfbad05c9f2008ed8e828b5faa3a03. --- doc/users/whats_new/fix_avconv.rst | 3 +++ lib/matplotlib/animation.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 doc/users/whats_new/fix_avconv.rst diff --git a/doc/users/whats_new/fix_avconv.rst b/doc/users/whats_new/fix_avconv.rst new file mode 100644 index 000000000000..afa033e37515 --- /dev/null +++ b/doc/users/whats_new/fix_avconv.rst @@ -0,0 +1,3 @@ +AVConv writer is back +--------------------- +Correct a bug that prevented detection of AVconv for matplotlib.animation. diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 074ec98e1f76..63a3db56d81f 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -616,7 +616,7 @@ def output_args(self): def _handle_subprocess(cls, process): _, err = process.communicate() # Ubuntu 12.04 ships a broken ffmpeg binary which we shouldn't use - if 'Libav' in err.decode(): + if 'Libav' in err.decode() and 'AVConv' not in cls.__name__: return False return True From e99096c1bb68d3c06f8ef83c5a040c7d0cc9f1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20Gouzien?= Date: Thu, 29 Jun 2017 22:55:52 +0200 Subject: [PATCH 2/2] Move the fix of 39d481dd5a47d4552100e505be6f0f4c8a5f78f5 in AVConvBase. --- lib/matplotlib/animation.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 63a3db56d81f..ad3db64b5280 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -616,7 +616,8 @@ def output_args(self): def _handle_subprocess(cls, process): _, err = process.communicate() # Ubuntu 12.04 ships a broken ffmpeg binary which we shouldn't use - if 'Libav' in err.decode() and 'AVConv' not in cls.__name__: + # NOTE : when removed, remove the same method in AVConvBase. + if 'Libav' in err.decode(): return False return True @@ -674,6 +675,11 @@ class AVConvBase(FFMpegBase): exec_key = 'animation.avconv_path' args_key = 'animation.avconv_args' + # NOTE : should be removed when the same method is removed in FFMpegBase. + @classmethod + def _handle_subprocess(cls, process): + return MovieWriter._handle_subprocess(process) + # Combine AVConv options with pipe-based writing @writers.register('avconv')