Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 68c31d7

Browse files
committed
Remove mencoder support.
Also removed movie_demo_sgskip, which was broken anyways (it did not import os); moviewrite_sgskip, which uses the animation API is a better example anyways (I don't think there's much of a point to show the flags for a specific encoder in an example -- if anything, that should go to the class docstring).
1 parent b42a9f8 commit 68c31d7

12 files changed

Lines changed: 10 additions & 159 deletions

File tree

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ test_script:
101101

102102
# this are optional dependencies so that we don't skip so many tests...
103103
- if x%TEST_ALL% == xyes conda install -q ffmpeg inkscape miktex pillow
104-
# missing packages on conda-forge for avconv mencoder imagemagick
104+
# missing packages on conda-forge for avconv imagemagick
105105
# This install sometimes failed randomly :-(
106106
#- choco install imagemagick
107107

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ addons:
3030
- libgeos-dev
3131
- libgirepository-1.0.1
3232
- lmodern
33-
- mencoder
3433
- otf-freefont
3534
- pgf
3635
- texlive-fonts-recommended

INSTALL.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ To run the test suite:
8484
:file:`lib\\mpl_toolkits\\tests` directories from the source distribution;
8585
* install test dependencies: `pytest <https://pypi.python.org/pypi/pytest>`_,
8686
`mock <https://pypi.python.org/pypi/mock>`_, Pillow, MiKTeX, GhostScript,
87-
ffmpeg, avconv, mencoder, ImageMagick, and `Inkscape
88-
<https://inkscape.org/>`_;
87+
ffmpeg, avconv, ImageMagick, and `Inkscape <https://inkscape.org/>`_;
8988
* run ``py.test path\to\tests\directory``.
9089

9190

doc/api/animation_api.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,3 @@ Inheritance Diagrams
302302

303303
.. inheritance-diagram:: matplotlib.animation.AVConvFileWriter matplotlib.animation.AVConvWriter matplotlib.animation.FFMpegFileWriter matplotlib.animation.FFMpegWriter matplotlib.animation.ImageMagickFileWriter matplotlib.animation.ImageMagickWriter
304304
:private-bases:
305-
306-
307-
308-
Deprecated
309-
==========
310-
311-
312-
.. autosummary::
313-
:toctree: _as_gen
314-
:nosignatures:
315-
316-
MencoderBase
317-
MencoderFileWriter
318-
MencoderWriter

doc/api/api_changes/2017-09-22-AL-removal-of-deprecated-features.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ The ``bgcolor`` keyword argument to ``Axes`` has been removed.
1515

1616
The ``spectral`` colormap has been removed. The ``Vega*`` colormaps, which
1717
were aliases for the ``tab*`` colormaps, have been removed.
18+
19+
``mencoder`` can no longer be used to encode animations.

examples/animation/movie_demo_sgskip.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

lib/matplotlib/animation.py

Lines changed: 2 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -702,88 +702,9 @@ class AVConvFileWriter(AVConvBase, FFMpegFileWriter):
702702
703703
Frames are written to temporary files on disk and then stitched
704704
together at the end.
705-
706705
'''
707706

708707

709-
# Base class of mencoder information. Contains configuration key information
710-
# as well as arguments for controlling *output*
711-
class MencoderBase(object):
712-
exec_key = 'animation.mencoder_path'
713-
args_key = 'animation.mencoder_args'
714-
715-
# Mencoder only allows certain keys, other ones cause the program
716-
# to fail.
717-
allowed_metadata = ['name', 'artist', 'genre', 'subject', 'copyright',
718-
'srcform', 'comment']
719-
720-
# Mencoder mandates using name, but 'title' works better with ffmpeg.
721-
# If we find it, just put it's value into name
722-
def _remap_metadata(self):
723-
if 'title' in self.metadata:
724-
self.metadata['name'] = self.metadata['title']
725-
726-
@property
727-
def output_args(self):
728-
self._remap_metadata()
729-
lavcopts = {'vcodec': self.codec}
730-
if self.bitrate > 0:
731-
lavcopts.update(vbitrate=self.bitrate)
732-
args = ['-o', self.outfile, '-ovc', 'lavc', '-lavcopts',
733-
':'.join(itertools.starmap('{0}={1}'.format,
734-
lavcopts.items()))]
735-
if self.extra_args:
736-
args.extend(self.extra_args)
737-
if self.metadata:
738-
args.extend(['-info', ':'.join('%s=%s' % (k, v)
739-
for k, v in six.iteritems(self.metadata)
740-
if k in self.allowed_metadata)])
741-
return args
742-
743-
744-
# The message must be a single line; internal newlines cause sphinx failure.
745-
mencoder_dep = ("Support for mencoder is only partially functional, "
746-
"and will be removed entirely in 2.2. "
747-
"Please use ffmpeg instead.")
748-
749-
750-
@writers.register('mencoder')
751-
class MencoderWriter(MovieWriter, MencoderBase):
752-
753-
@deprecated('2.0', message=mencoder_dep)
754-
def __init__(self, *args, **kwargs):
755-
with rc_context(rc={'animation.codec': 'mpeg4'}):
756-
super(MencoderWriter, self).__init__(*args, **kwargs)
757-
758-
def _args(self):
759-
# Returns the command line parameters for subprocess to use
760-
# mencoder to create a movie
761-
return [self.bin_path(), '-', '-demuxer', 'rawvideo', '-rawvideo',
762-
('w=%i:h=%i:' % self.frame_size +
763-
'fps=%i:format=%s' % (self.fps,
764-
self.frame_format))] + self.output_args
765-
766-
767-
# Combine Mencoder options with temp file-based writing
768-
@writers.register('mencoder_file')
769-
class MencoderFileWriter(FileMovieWriter, MencoderBase):
770-
supported_formats = ['png', 'jpeg', 'tga', 'sgi']
771-
772-
@deprecated('2.0', message=mencoder_dep)
773-
def __init__(self, *args, **kwargs):
774-
with rc_context(rc={'animation.codec': 'mpeg4'}):
775-
super(MencoderFileWriter, self).__init__(*args, **kwargs)
776-
777-
def _args(self):
778-
# Returns the command line parameters for subprocess to use
779-
# mencoder to create a movie
780-
return [self.bin_path(),
781-
'mf://%s*.%s' % (self.temp_prefix, self.frame_format),
782-
'-frames', str(self._frame_counter), '-mf',
783-
'type=%s:fps=%d' % (self.frame_format,
784-
self.fps)] + self.output_args
785-
786-
787708
# Base class for animated GIFs with convert utility
788709
class ImageMagickBase(object):
789710
'''Mixin class for ImageMagick output.
@@ -1102,8 +1023,8 @@ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
11021023
11031024
writer : :class:`MovieWriter` or str, optional
11041025
A `MovieWriter` instance to use or a key that identifies a
1105-
class to use, such as 'ffmpeg' or 'mencoder'. If ``None``,
1106-
defaults to ``rcParams['animation.writer']``.
1026+
class to use, such as 'ffmpeg'. If ``None``, defaults to
1027+
``rcParams['animation.writer']``.
11071028
11081029
fps : number, optional
11091030
Frames per second in the movie. Defaults to ``None``, which will use

lib/matplotlib/mpl-data/stylelib/_classic_test.mplstyle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,6 @@ animation.ffmpeg_args: # Additional arguments to pass to ffmpeg
504504
animation.avconv_path: avconv # Path to avconv binary. Without full path
505505
# $PATH is searched
506506
animation.avconv_args: # Additional arguments to pass to avconv
507-
animation.mencoder_path: mencoder
508-
# Path to mencoder binary. Without full path
509-
# $PATH is searched
510-
animation.mencoder_args: # Additional arguments to pass to mencoder
511507
animation.convert_path: convert # Path to ImageMagick's convert binary.
512508
# On Windows use the full path since convert
513509
# is also the name of a system tool.

lib/matplotlib/mpl-data/stylelib/classic.mplstyle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,10 +506,6 @@ animation.ffmpeg_args: # Additional arguments to pass to ffmpeg
506506
animation.avconv_path: avconv # Path to avconv binary. Without full path
507507
# $PATH is searched
508508
animation.avconv_args: # Additional arguments to pass to avconv
509-
animation.mencoder_path: mencoder
510-
# Path to mencoder binary. Without full path
511-
# $PATH is searched
512-
animation.mencoder_args: # Additional arguments to pass to mencoder
513509
animation.convert_path: convert # Path to ImageMagick's convert binary.
514510
# On Windows use the full path since convert
515511
# is also the name of a system tool.

lib/matplotlib/rcsetup.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,6 @@ def validate_hinting(s):
580580
validate_movie_writer = ValidateInStrings('animation.writer',
581581
['ffmpeg', 'ffmpeg_file',
582582
'avconv', 'avconv_file',
583-
'mencoder', 'mencoder_file',
584583
'imagemagick', 'imagemagick_file',
585584
'html'])
586585

@@ -1371,23 +1370,17 @@ def _validate_linestyle(ls):
13711370
'animation.frame_format': ['png', validate_movie_frame_fmt],
13721371
# Additional arguments for HTML writer
13731372
'animation.html_args': [[], validate_stringlist],
1374-
# Path to FFMPEG binary. If just binary name, subprocess uses $PATH.
1373+
# Path to ffmpeg binary. If just binary name, subprocess uses $PATH.
13751374
'animation.ffmpeg_path': ['ffmpeg', validate_animation_writer_path],
1376-
13771375
# Additional arguments for ffmpeg movie writer (using pipes)
13781376
'animation.ffmpeg_args': [[], validate_stringlist],
13791377
# Path to AVConv binary. If just binary name, subprocess uses $PATH.
13801378
'animation.avconv_path': ['avconv', validate_animation_writer_path],
13811379
# Additional arguments for avconv movie writer (using pipes)
13821380
'animation.avconv_args': [[], validate_stringlist],
1383-
# Path to MENCODER binary. If just binary name, subprocess uses $PATH.
1384-
'animation.mencoder_path': ['mencoder', validate_animation_writer_path],
1385-
# Additional arguments for mencoder movie writer (using pipes)
1386-
'animation.mencoder_args': [[], validate_stringlist],
1387-
# Path to convert binary. If just binary name, subprocess uses $PATH
1381+
# Path to convert binary. If just binary name, subprocess uses $PATH.
13881382
'animation.convert_path': ['convert', validate_animation_writer_path],
1389-
# Additional arguments for mencoder movie writer (using pipes)
1390-
1383+
# Additional arguments for convert movie writer (using pipes)
13911384
'animation.convert_args': [[], validate_stringlist],
13921385

13931386
# Classic (pre 2.0) compatibility mode

0 commit comments

Comments
 (0)