Wednesday, October 31, 2007

How to make screen movies w/voiceover.

People have asked me how I make my HOWTO movies, like [this one](http://pong.tamu.edu/~rob/movies/roms_project.mov). The good news is that it is ridiculously simple.

python gets some love from Leopard

[It seems](http://www.cmlenz.net/blog/2007/10/python-on-leopa.html) that Mac OS X Leopard has quite a few excellent features installed by default. Including numpy!

Monday, October 15, 2007

Unix things I did not know..

Some interesting unix commands I recently discovered: xargs and seq. With these you can do this, for example:

Find all of the files named foo, and create a tar file:

find . -name foo | xargs tar cvfz tarfile.tar.gz

Iterate through your cluster nodes:

for i in `seq 0 7` ; do scp foolib c0-$i:/usr/local/lib ; done

Monday, October 8, 2007

movies from sequences of files.

Based on some advice I found [here](http://electron.mit.edu/~gsteele/ffmpeg/), I discovered how to make high quality movies from series of png files using [ffmpeg](http://ffmpeg.mplayerhq.hu/). I use png files because they have a high color depth (unlike 256 for gif), and they are non-lossy (unlike jpg).

First you need to make a sequence of _ordered_ files that have filenames like frame\_001.png, frame\_002.png, etc. For example, in python's matplotlib, you would have a line like:

saveframe('frame_%03d.png' % framenumber)

Then, you need to run ffmpeg on all of these files. The command is quite simple:

ffmpeg -r 10 -sameq -i frame_%03d.png test.mp4

where the -r flag sets the frames per second. Otherwise, the only other key option is the -sameq flag, which keeps the same non-lossy quality of the png files. Pretty easy. Also, you don't need to install xvid or h264 libraries for this to work. The codecs that come with ffmpeg seem to work just fine.

Also, the size of the resulting movie file is quite reasonable. I tested 121 frames at 1000x600 (with considerable non-changing space in the field). The resulting movie was 2.8M big. This is about seven times smaller than simply concatenating all of the images together. Not too bad.

Sunday, October 7, 2007

public access large-scale model data

This may not be new news, but it was a good find. Here is a very extensive archive of publicly available model output. This could be used, for example, for regional model boundary conditions:

[http://apdrc.soest.hawaii.edu/dods/public_data/](http://apdrc.soest.hawaii.edu/dods/public_data/)

An example python script for making a movie of ssh in the Indian ocean from the Navy Layer Ocean Model is found after the fold