Monday, September 21, 2009

More Desktop Code

Although my focus for the last 20 months has been the iPhone, I've tried to stay at least in touch with Cocoa for the Mac. As a result, I tend to start a lot of small projects designed to help me learn, re-learn, or brush up on some specific area of functionality. A lot of these projects just end up gathering dust on my hard drive and are never used in any kind of production application, so since I'm doing a little housecleaning, I thought I'd post some of these projects that might be useful to iPhone developers wanting to get into Mac development or for newer Mac developers.

I've written several Cocoa applications over the years that work with Quicktime, including Crimson FX, a simple rotoscoping and special effects application. Back when I wrote these, most of the Quicktime functionality had to be accessed through Carbon calls. Since then, there have been several major releases of Quicktime, and Cocoa has gained some very robust Quicktime support by way of QTKit.

To familiarize myself with Cocoa's current Quicktime functionality, I wrote a small application that loads in a Quicktime movie and allows you to step through it frame-by-frame or to scrub through the frames using a slider. There's also a custom view that displays a filmstrip timeline, similar to the way iMovie displays a timeline.

This is neither a full-featured, nor a production-ready application, but if you're interested in writing a Cocoa application that needs to do more with Quicktime than simply play a movie, you may find some of the code in here useful. In addition to the filmstrip view, there's also a category that adds several methods to QTMovie for dealing with the individual frames of a movie's video track.

You can find the project here. As always, there are no restrictions on the use of this code, and I welcome any improvements or bug fixes you might come up with.


Dethe Elza said...

Any chance you will update CrimsonFX at some point? It worked fine under Tiger, but broke with Leopard. Or, failing that, would you give me some pointers where to start? I'm long-time programmer, but still an amateur with Cocoa (especially Objective-C, most of my Cocoa programming was in Python until recently).


Jeff LaMarche said...


Not likely any time soon. I've toyed with the idea, but it's hard to carve out time for something like this.

The main reason it stopped working was due to changes in Quicktime between 6 and 7, although there are other issues. I wrote this before Core Image, so the drawing acceleration was all done using altivec, which doesn't work under Intel.

It's been so long since I've looked at the code, I honestly wouldn't even know where to begin. So much has changed since Jaguar (which was the current OS when I wrote it) that I suspect it would be a fair amount of work to get it running under Leopard/Snow Leopard and Intel.

Dethe Elza said...

OK, thanks for the info. At least I feel a little better about not knowing where to begin with it.

Kind regards

Jeff LaMarche said...

Funny, I just looked at it, and it's not as bad as I thought. To do it as a commercial product, I'd want to switch my convolution kernel code to using Core Image, but I was wrong about the vectorization - I have both vectorized and non-vectorized version, so it does work on Intel - I just tried it out.

It probably wouldn't be that bad to get working. Unfortunately, I don't have time right now to work on it.

dorla said...

Thanks for the sharing this website. it is very useful professional knowledge. Great idea you know about company background.
web application development