Quartz Composer Discoveries

Made a couple of discoveries last night, which I thought would be worth sharing, about Mac OS X Tiger's Quartz Composer development tool (which I mentioned here earlier). Basically, I was having a look at the .qtz files it produces, determined to find something I can do with them other than make screensavers, and discovered:

  1. They're binary-format PList files. You can open them in the PList Editor tool, which also means you can save them out as XML. The reverse transformation is also possible, which means that dynamically creating .qtz files should be possible by writing out or transforming XML data, then converting to binary PList. The contents of the PList is just descriptive of the structure of your composition - nodes and connections - not of the rendered output or, seemingly, any compiled code (although there is a quantity of binary data in the .qtz file that could be some sort of bytecode). Could imply that .qtz files are really purely declarative programs - source-code, if you like.
  2. Quicktime player can open them. Drag one onto the big blue Q, and it'll play as a thirty-second movie. Given the previous discovery, of course, this means that the engine for interpreting .qtz PLists and turning them into Core Graphics code must be available to Quicktime 7. What else uses Quicktime 7?...
  3. How about iMovie? Well, yes, indeed, you can drag them directly into iMovie. This is where it gets interesting, because iMovie renders them out, frame by frame, into a 30 second .dv file (you can trim this down, and there's a workaround for getting longer clips I'll come to in a moment). This rendering step means you can apply arbitrarily complex transformation and rendering sequences that would never play out in real time, but iMovie will render them as a raw set of .dv frames for you that can be played back at full speed.
  4. There's a sample app that comes with XCode called Quartz Composer Viewer. You can use it to view .qtz files fullscreen. Seems a little buggy in my (limited) playing with it.

As well as the direct opening of .qtz files with Quicktime Player and iMovie, I also investigated the way Quartz Composer's 'Export as Quicktime Movie' menu option works. Obviously, since Quicktime's quite capable of dealing with raw .qtz data, it doesn't need to render out video frames for the .mov file - it simply encodes the .qtz file inside a Quicktime channel wrapper, and leaves it up to the Quicktime client to figure out how to display it. Naturally, this means this sort of exported .mov file isn't going to work on PCs and isn't even going to render on every Mac. So, not much of an export, really.

The advantage of exporting to a .mov file, though, is that you get to specify a duration. If your motion runs much longer or shorter than the 30 second default Quicktime assumes when given raw .qtz data, you'll want to wrap the .qtz file in a .mov with the correct duration. Then, you can drag your movie into iMovie, and have each frame lovingly composited into raw .dv for the exact duration you specified.

Anyway, that's all for now. Still working on finding a way of getting .qtz files with a pair of published 'image' inputs to function as transitions...

Print | posted on Thursday, May 05, 2005 11:35 AM

Comments on this post

# re: Quartz Composer Discoveries

Requesting Gravatar...
> You can use it to view .qtz files fullscreen.

Which it took me a while to notice, but you can also do in Quartz Composer iteslf. There's a toolbar on the viewer window thats hidden by default. Turn it on by clicking the button in the upper-right corner of the viewer, and you'll have various debugging options, as well as a full-screen view.

> If your motion runs much longer or shorter than the 30 second default Quicktime assumes when given raw .qtz data, you'll want to wrap the .qtz file in a .mov with the correct duration.

Oddly enough, I found QC was likely to crash if I tried to export to a QuickTime movie of less than 30 seconds.

> Anyway, that's all for now. Still working on finding a way of getting .qtz files with a pair of published 'image' inputs to function as transitions...

Make sure you've read up on using the QC clip library. See http://developer.apple.com/documentation/GraphicsImaging/Conceptual/QuartzComposer/qc_scr_qtmov/chapter_7_section_4.html

Left by Brendan Price on May 20, 2005 1:52 PM

# re: Quartz Composer Discoveries

Requesting Gravatar...
For lots of quartz composer samples check out the following website:

http://www.quartzcompositions.com
Left by Niclas Bahn on Jun 21, 2005 6:00 PM

# re: Quartz Composer Discoveries

Requesting Gravatar...
hi
how do you make it into a .mov wrapper? neither the export nor save as options allow u to specify a movie length. and once you export, it seems to render qtz file into whatever format u've specified?
Left by john on Jul 30, 2005 10:51 PM

# re: Quartz Composer Discoveries

Requesting Gravatar...
There is a way to give the Quartz files a much longer duration. The web page to find this info is: http://developer.apple.com/technotes/tn2005/tn2145.html

Copied from the page -
"Listing 3: Setting the default Quartz Composer QuickTime tracks duration from the Terminal.

defaults write NSGlobalDomain QuartzComposerDefaultMovieDuration 300"

I am using quartz files as templates for bumpers in Final Cut Pro. It's necessary to have QuickTime Pro to do this, but you can RESIZE the Quartz file in QT PRo using the Properties window (cmd+j) and then scaling the image up. Then, save it as a Reference QuickTime movie and bring it into FCP.

When you place it on the timeline, you'll need to remove the inherited Basic Motion. Then it will fill the screen.

Have Fun!
PXLGUY
Left by Trent Armstrong on Aug 06, 2007 9:04 PM

# re: Quartz Composer Discoveries

Requesting Gravatar...
Have you found the resolution to be drastically smaller when transferring quartz files (qtz. or quicktime) to imovie?
Left by BerlinStudios on Jul 13, 2008 4:12 AM

Your comment:

 (will show your gravatar)
 
Please add 1 and 6 and type the answer here: