I did take a look at the wiki, but for some reason I couldn't get it working first pass. I'll try again. I also realized that the Animation classes will have to be a bit more complex than I originally though, as they are essentially iterators, so they should be broken up into: ForwardAnimation, BidirectionalAnimation, and RandomAnimation.
Also, perhaps of general interest, my method of creating .MPG files with convert failed recently due to my movies being too long, and the huge number of frames cause convert to break (too many parameters on command line). Having no other options, I created a wrapper for FFMPEG. To save time (and so perhaps a better/more complete method would be better..) I have attached the library to this message, in case it helps anyone else. Of the many caveats:
(1) Only three functions are exposed, instead of the full functionality of FFMPEG. On the plus side, it's pretty easy to make a movie now.
(2) Most of the code is copied from output_example.c, from the FFMPEG source. This is in part because there is little to no documentation that comes with the library. To save time I kept most of the source code the same, but just encapsulated in with a C++ class. There are a couple things done in it, which I have left alone, but have no clue what they do (if anyone has any suggestions as to what they do [e.g. how to determine the size of video_outbuf_size], it would be greatly appreciated).
(3) I've never touched anything related to video before, so there's a good chance I messed up a bunch of other stuff.
(4) I used Boost::Python instead of SWIG, mainly because I know Boost::Python, and I don't know SWIG.
(5) You will need (of course) FFMPEG installed on your computer (the CVS version is considered the most correct version to run)
With that said, it seems to work fairly well. Along with the library, I included a small test python program that shows how to use it (simulating the game of life). One things I've noticed, is that with graphs, to get any decent quality from the MPEG, you have to set the bitrate extremely high..
pyanim.tar.gz (3.95 KB)
While longer term a cross platform animation mpeg wrapper toolkit
would indeed be nice, in the short term I think that classes like this
can be very useful to make animation easier. One thing I would like
to see is support for the recent matplotlib bbox/blit animation
features, which can make animation an order of magnitude faster. Have
you perused the animation wiki?
Beyond that, you may want to look at the RectangleSelector and
HorizontalSpanSelector in the widgets.py file to see how they handle
connections to draw_events, etc....
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
Matplotlib-devel mailing list