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 2c97d51

Browse filesBrowse files
committed
Revert "Remove unused/deprecated AVConv_ classes"
This reverts commit e29e69e.
1 parent 5fcb7d8 commit 2c97d51
Copy full SHA for 2c97d51

File tree

Expand file treeCollapse file tree

1 file changed

+50
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+50
-0
lines changed

‎lib/matplotlib/animation.py

Copy file name to clipboardExpand all lines: lib/matplotlib/animation.py
+50Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,17 @@ def output_args(self):
584584

585585
return args + ['-y', self.outfile]
586586

587+
@classmethod
588+
def isAvailable(cls):
589+
return (
590+
super().isAvailable()
591+
# Ubuntu 12.04 ships a broken ffmpeg binary which we shouldn't use.
592+
# NOTE: when removed, remove the same method in AVConvBase.
593+
and b'LibAv' not in subprocess.run(
594+
[cls.bin_path()], creationflags=subprocess_creation_flags,
595+
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
596+
stderr=subprocess.PIPE).stderr)
597+
587598

588599
# Combine FFMpeg options with pipe-based writing
589600
@writers.register('ffmpeg')
@@ -629,6 +640,45 @@ def _args(self):
629640
'-vframes', str(self._frame_counter)] + self.output_args
630641

631642

643+
# Base class of avconv information. AVConv has identical arguments to FFMpeg.
644+
@cbook.deprecated('3.3')
645+
class AVConvBase(FFMpegBase):
646+
"""
647+
Mixin class for avconv output.
648+
649+
To be useful this must be multiply-inherited from with a
650+
`MovieWriterBase` sub-class.
651+
"""
652+
653+
_exec_key = 'animation.avconv_path'
654+
_args_key = 'animation.avconv_args'
655+
656+
# NOTE : should be removed when the same method is removed in FFMpegBase.
657+
isAvailable = classmethod(MovieWriter.isAvailable.__func__)
658+
659+
660+
# Combine AVConv options with pipe-based writing
661+
@writers.register('avconv')
662+
class AVConvWriter(AVConvBase, FFMpegWriter):
663+
"""
664+
Pipe-based avconv writer.
665+
666+
Frames are streamed directly to avconv via a pipe and written in a single
667+
pass.
668+
"""
669+
670+
671+
# Combine AVConv options with file-based writing
672+
@writers.register('avconv_file')
673+
class AVConvFileWriter(AVConvBase, FFMpegFileWriter):
674+
"""
675+
File-based avconv writer.
676+
677+
Frames are written to temporary files on disk and then stitched
678+
together at the end.
679+
"""
680+
681+
632682
# Base class for animated GIFs with ImageMagick
633683
class ImageMagickBase:
634684
"""

0 commit comments

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