8000 Animation fixes by jdh2358 · Pull Request #1012 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Animation fixes #1012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make sure that the MovieWriter base class gets the args and kwargs on…
… init of the FFMpegWriter and friends
  • Loading branch information
jdh2358 committed Jul 15, 2012
commit a2ca359eb05f1a16a1d48dec9cf147d0a4fbd0c5
22 changes: 21 additions & 1 deletion lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def isAvailable(cls):
class FileMovieWriter(MovieWriter):
'`MovieWriter` subclass that handles writing to a file.'
def __init__(self, *args, **kwargs):
MovieWriter.__init__(self, *args)
MovieWriter.__init__(self, *args, **kwargs)
self.frame_format = rcParams['animation.frame_format']

def setup(self, fig, outfile, dpi, frame_prefix='_tmp', clear_temp=True):
Expand Down Expand Up @@ -354,6 +354,11 @@ def output_args(self):
# Combine FFMpeg options with pipe-based writing
@writers.register('ffmpeg')
class FFMpegWriter(MovieWriter, FFMpegBase):
def __init__(self, *args, **kwargs):
# FFMpegBase doesn't have an init method so we need to make
# sure the MovieWriter gets called with our args and kwargs
MovieWriter.__init__(self, *args, **kwargs)

def _args(self):
# Returns the command line parameters for subprocess to use
# ffmpeg to create a movie using a pipe
Expand All @@ -366,6 +371,11 @@ def _args(self):
@writers.register('ffmpeg_file')
class FFMpegFileWriter(FileMovieWriter, FFMpegBase):
supported_formats = ['png', 'jpeg', 'ppm', 'tiff', 'sgi', 'bmp', 'pbm', 'raw', 'rgba']
def __init__(self, *args, **kwargs):
# FFMpegBase doesn't have an init method so we need to make
# sure the FileMovieWriter gets called with our args and kwargs
FileMovieWriter.__init__(self, *args, **kwargs)

def _args(self):
# Returns the command line parameters for subprocess to use
# ffmpeg to create a movie using a collection of temp images
Expand Down Expand Up @@ -406,6 +416,11 @@ def output_args(self):
# Combine Mencoder options with pipe-based writing
@writers.register('mencoder')
class MencoderWriter(MovieWriter, MencoderBase):
def __init__(self, *args, **kwargs):
# MencoderBase doesn't have an init method so we need to make
# sure the MovieWriter gets called with our args and kwargs
MovieWriter.__init__(self, *args, **kwargs)

def _args(self):
# Returns the command line parameters for subprocess to use
# mencoder to create a movie
Expand All @@ -418,6 +433,11 @@ def _args(self):
@writers.register('mencoder_file')
class MencoderFileWriter(FileMovieWriter, MencoderBase):
supported_formats = ['png', 'jpeg', 'tga', 'sgi']
def __init__(self, *args, **kwargs):
# MencoderBase doesn't have an init method so we need to make
# sure the MovieWriter gets called with our args and kwargs
MovieWriter.__init__(self, *args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you mean "FileMovieWriter" here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I'll fix this


def _args(self):
# Returns the command line parameters for subprocess to use
# mencoder to create a movie
Expand Down
0