8000 Animation subprocess bug by tonysyu · Pull Request #989 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Animation subprocess bug #989

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

Merged
merged 2 commits into from
Jul 20, 2012
Merged
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
Add print-out of ffmpeg output when debugging.
  • Loading branch information
tonysyu committed Jul 7, 2012
commit 467fa90cdb8e364182deb361d5b293c1990f0560
20 changes: 14 additions & 6 deletions lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# * Movies
# * Can blit be enabled for movies?
# * Need to consider event sources to allow clicking through multiple figures
import sys
import itertools
import contextlib
import subprocess
Expand Down Expand Up @@ -175,10 +176,14 @@ def _run(self):
# movie file. *args* returns the sequence of command line arguments
# from a few configuration options.
command = self._args()
if verbose.ge('debug'):
output = sys.stdout
else:
output = subprocess.PIPE
verbose.report('MovieWriter.run: running command: %s'%' '.join(command))
self._proc = subprocess.Popen(command, shell=False,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
stdin=subprocess.PIPE)
stdout=output, stderr=output,
stdin=subprocess.PIPE)

def finish(self):
'Finish any processing for writing the movie.'
Expand Down Expand Up @@ -357,11 +362,14 @@ class FFMpegWriter(MovieWriter, FFMpegBase):
def _args(self):
# Returns the command line parameters for subprocess to use
# ffmpeg to create a movie using a pipe.
# Logging is quieted because subprocess.PIPE has limited buffer size.
return [self.bin_path(), '-f', 'rawvideo', '-vcodec', 'rawvideo',
args = [self.bin_path(), '-f', 'rawvideo', '-vcodec', 'rawvideo',
'-s', '%dx%d' % self.frame_size, '-pix_fmt', self.frame_format,
'-r', str(self.fps), '-loglevel', 'quiet',
'-i', 'pipe:'] + self.output_args
'-r', str(self.fps)]
# Logging is quieted because subprocess.PIPE has limited buffer size.
if not verbose.ge('debug'):
args += ['-loglevel', 'quiet']
args += ['-i', 'pipe:'] + self.output_args
return args


#Combine FFMpeg options with temp file-based writing
Expand Down
0