be your own Aronofsky

I've now got an iSight camera built into the lid of my laptop. Naturally, I've been unable to resist the urge to play with it, so I spent about a minute on Wednesday morning writing a Perl script designed to take a steady stream of images. Then I let it run throughout the day. The results are pretty creepy, like a drug-use montage. And, yeah, a little longer than I'd like — but there are special guest appearances beginning about halfway through.

The Benny Hill music seemed like a much funnier idea when I was in a post-flight delirium. You should probably just mute it. Oh, and the weird chewing is from the cough drops that I was downing with disgusting regularity.

Lots of other people have taken videos like this one, and I'm sure there are better methods. But if you're curious to try it yourself, here's how I did it:

  1. Download and install iSightCapture.
  2. Copy this perl script to an empty directory and run it from there. Use control-C to stop it when you've taken enough shots.
    #!/usr/bin/perl
    
    while(1==1)
    {
            # grab a shot and name it in order
            my $time = time();
            `isightcapture $time.jpg`;
    
            # wait for one second. because of the 
            # time isightcapture takes to run, 
            # this results in roughly one exposure
            # every three seconds
            sleep(1);
    }
  3. Download and compile JpegToAvi (it may be finicky about compiling on OS X — I had to run it from a Linux machine). Run the executable (while in the directory with all the JPEGs) like so:
    ls *.jpg | tr '\n' ' ' | /path/to/jpegtoavi -f 30 640 480 > output.avi
  4. Edit the AVI in your program of choice — I used iMovie to add the music and strip out the parts where we went for lunch or coffee. Then export it to a compressed format and upload it to your favorite video-sharing site. Don't bother with YouTube: I tried it twice and with a variety of export formats, and it choked on the file each time, producing clips that were only one second long. Blip.tv worked great, though.

Comments

Interesting. Somewhat hypnotic. I could see this being worked into a storyline on CSI or something. ...

 

You are a mad genius, Tommy. But be honest: did you dress up for the camera? I expected to see a clever t-shirt.

 

No, not for the camera. If the meeting had been in our DC office I might've been in a t-shirt. But when I cross an ocean for an appointment, I try to dress up at least a little. Although it should be pointed out that I wore a sweater in order to conceal how laughably wrinkled my shirt was.

I did pose a little though -- took langorous sips of coffee in order to be sure the camera caught them, for example. You know, to help establish the narrative.

 

It's all fun and games until the music stops... Then it's just outright creepy.

 

Still interested in jpegtoavi on OS X? I've patched it so it works, but I haven't put the instructions up anywhere yet. I can send you a copy or the instructions if you like.

 

Thanks for the offer, Tim. I ended up getting it to run on my Linux environment fine, though, and I've since then successfully used ffmpeg (which is available for OS X, of course) to compile stills into video files. So I'm all set -- although of course I'd still encourage you to put your patch online somewhere.

 

With your encouragement, I have.

jpegtoavi for Mac OS X

I work with IP cameras and need to convert from their proprietary format into something cross-platform. ffmpeg is alright, but it's pretty complicated for what I need. jpegtoavi fits into my scripts nicely and is super fast.

 

Excellent! Thanks so much for doing so. I'm sure others will benefit from your work (heck, I probably will, too).

 

Post a comment