I have been lucky enough to have a chance to do some of my more basic data processing in Python (with numpy/scipy/matplotlib). One of the things I’ve been working on is the effect of interference between the direct path and surface bounce arrivals from a fin whale that is near the surface. Hopefully I’ll have a post dedicated to that problem in particular, but for the time being, I’ve been trying to figure out the best way to animate a series of plots output each time the code goes through a loop.
There are a few options for doing this. From what I can gather, it’s not something that is easily done within Python (someone correct me if that’s wrong!). So instead, I’m creating a series of image files (.png’s), and converting to video outside Python. I looked at a couple of options and settled on ffmpeg, which seemed really simple.
I grabbed it from fink:
fink install ffmpeg
All of my image files were saved in a single folder, with names like 001.png, 002.png, … 198.png. Converting them to video format:
ffmpeg -i %03d.png -vb 1024K video.mpg
The -i flag is for input file(s) and -vb is video bitrate. Here’s the output: