Matplotlib-Animation "No Moviewriters Available"

Matplotlib-Animation No MovieWriters Available

Had the same problem....managed to get it to work after a little while.

Thing to do is follow instructions on installing FFmpeg - which is (at least on windows) a bundle of executables you need to set a path to in your environment variables

http://www.wikihow.com/Install-FFmpeg-on-Windows

Download from ffmpeg.org

Hope this helps someone - even after a while after the question - good luck

RuntimeError: No MovieWriters available in Matplotlib animation

Try to specify path to ffpmeg program manually like

import matplotlib.pyplot as plt
plt.rcParams['animation.ffmpeg_path'] = '/usr/local/bin/ffmpeg'

You have to put these code lines at the beginning of a script and then use animation Writer.

MovieWriter ffmpeg unavailable; trying to use class 'matplotlib.animation.PillowWriter' instead

You can save animated plot as .gif with use of celluloid library:

from matplotlib import pyplot as plt
from celluloid import Camera
import numpy as np

# create figure object
fig = plt.figure()
# load axis box
ax = plt.axes()
# set axis limit
ax.set_ylim(0, 1)
ax.set_xlim(0, 10)

camera = Camera(fig)
for i in range(10):
ax.scatter(i, np.random.random())
plt.pause(0.1)
camera.snap()

animation = camera.animate()
animation.save('animation.gif', writer='PillowWriter', fps=2)

Output:

Sample Image

Matplotlib animation MovieWriters fails on Ubuntu 12.04

If you are using the unbuntu packaged version of matplotlib it is 1.1.1rc1. The attribute writers was added about 3 months after that tag, and is in versions 1.2 and later.

You can either install matplotlib from source (this is what I do, it's not too bad) or use the daily ppa.

My advice for compiling from source is to use the packaging system for as many of the dependencies as possible and install matplotlib by hand (if you do want to use pip see this answer) as such

git clone git://github.com/matplotlib/matplotlib.git
cd matplotlib
git checkout -b v1.2.0
python setup.py install --prefix=/home/username/local_installs/

(which will get you the latest stable version) then make sure the path where it got installed is in your $PYTHONPATH which can be done by including the line

export PYTHONPATH=/home/username/local_installs/lib/python2.7/site-packages/:$PYTHONPATH

in your ~/.bashrc file. You might have to vary that line a bit depending on which version of python you use. You might need to do this (and make sure folders exist) before setup.py will be happy.

MovieWriter (ffmpeg) not available PyCharm (Windows)

You can specify the ffmpeg path directly as follows:

plt.rcParams['animation.ffmpeg_path'] = 'ffmpeg path on your machine' (e.g.: "C:\FFmpeg\bin\ffmpeg.exe")

or try on your cmd calling the ffmpeg to make sure the have properly defined its path in your env variables.

to get the path after making sure the path s properly defined, write in your cmd:

where ffmpeg 


Related Topics



Leave a reply



Submit