Skip to content
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

N Pendlum example can't make the ogv movies anymore #17

Closed
moorepants opened this issue Jan 24, 2014 · 2 comments
Closed

N Pendlum example can't make the ogv movies anymore #17

moorepants opened this issue Jan 24, 2014 · 2 comments

Comments

@moorepants
Copy link
Member

This may be related to an upgrade in ubuntu and ffmpeg.

See this issue:

matplotlib/matplotlib#2764

@amunizp
Copy link

amunizp commented Dec 11, 2014

Does not work on windows 7 using VERSION 1.3.1 of matplotlib.

Sample code

# -*- coding: utf-8 -*-
"""
Created on Thu Dec 11 11:52:11 2014

@author: amp
http://matplotlib.org/examples/index.html#examples-index

"""
# This example uses a MovieWriter directly to grab individual frames and
# write them to a file. This avoids any event loop integration, but has
# the advantage of working with even the Agg backend. This is not recommended
# for use in an interactive setting.
# -*- noplot -*-

import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.animation as manimation

FFMpegWriter = manimation.writers['ffmpeg']
metadata = dict(title='Movie Test', artist='Matplotlib',
        comment='Movie support!')
writer = FFMpegWriter(fps=15, metadata=metadata)

fig = plt.figure()
l, = plt.plot([], [], 'k-o')

plt.xlim(-5, 5)
plt.ylim(-5, 5)

x0,y0 = 0, 0

with writer.saving(fig, "writer_test2.ogv", 100):
    for i in range(100):
        x0 += 0.1 * np.random.randn()
        y0 += 0.1 * np.random.randn()
        l.set_data(x0, y0)
        writer.grab_frame()

@moorepants
Copy link
Member Author

@amunizp It would probably be better to report this on matplotlib's issue tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants