Ffmpeg prints a lot of info to stderr. For longer animations, this logging fills up the (very-small) buffer for subprocess.PIPE and subprocess just hangs (with no error).
This PR suppresses logging in ffmpeg to prevent this issue. If matplotlib's verbosity level is set to 'debug*', then ffmpeg's output is piped to stdout.
Edit: I forgot to post code that reproduces the issue. This is pretty much what I posted to the mailing list. I use streamplot mainly because it produces more ffmpeg output so it fails with fewer iterations. The following should hang (this seems to vary on my system, but it's usually close to 200 frames in).
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig, ax = plt.subplots()
# do nothing function that prints frame
Y, X = np.mgrid[:1:100j, :1:100j]
U = np.ones_like(X)
V = np.ones_like(X)
ax.streamplot(X, Y, U, V, density=1)
ani = animation.FuncAnimation(fig, update, save_count=500)
Fix subprocess bug when saving animations.
Ffmpeg prints a lot of info to stderr. For longer animations, this logging fills up the (very-small) buffer for subprocess.PIPE and subprocess just hangs (no error). Suppress logging in ffmpeg to prevent this issue.
Add print-out of ffmpeg output when debugging.
Merge pull request #989 from tonysyu/animation-subprocess-bug
Fix a bug with too much output from ffmpeg stalling the pipe.
Looks good. Nice work.