@@ -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
788709class 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
0 commit comments