Thursday, September 25, 2008

Compiling x264 with MP4 support on OS X

I've been wanting to futz around with the internals of a modern video codec, and since H.264 seems like a pretty happening codec, and the x264 project seems pretty awesome, I downloaded their source and tried compiling it on my Mac. I hit a few roadbumps, so here are instructions for anyone else who wants to compile x264 on OS X:


wget http://downloads.sourceforge.net/gpac/gpac-0.4.4.tar.gz
open gpac # lazy-man's untar
git clone git://git.videolan.org/x264.git x264
cd gpac
find . -name os_net.c | xargs perl -pi -e 's/u_long/unsigned long/g'
./configure
make lib
make install-lib

cd ../x264
./configure --enable-mp4-output
make


Then, to test that everything worked, run this:

wget notlime.com/2008/h264/foreman_part_qcif.yuv
./x264 -v -q 20 -o foreman.mp4 foreman_part_qcif.yuv 176x144
open foreman.mp4


If you don't have git installed, you can find a nightly tarball of the x264 source code at ftp://ftp.videolan.org/pub/videolan/x264/snapshots/. Hope this helps someone!

Tuesday, September 2, 2008

Growing Triangle Vines

When I was in school I was addicted to making Processing sketches. I haven't been as active recently, but made these in the past month and a half.

The first is a visualization of a geometric computation that we used in the ICFP contest: Arcsin of R / D

And the second comes from a pen-and-paper sketch made on a legal pad during my WTC tenure: Iconic Growing Triangles