Important: This document does not represent best practices for current development. You should convert your app to use AVFoundation instead. See Transitioning QTKit Code to AV Foundation.
QTKit is a Cocoa-based, Objective-C framework (
QTKit.framework) with a rich and evolving API for manipulating time-based media. Introduced in OS X v10.4, QTKit provides a set of Objective-C classes and methods specifically designed to handle the basic chores of playback, editing, export, audio/video capture and recording, in addition to a number of other multimedia capabilities. Each iteration of the framework from Apple, accompanying the latest release of OS X, has extended the power and reach of the API.
Toward that end, OS X v10.6 introduces QuickTime X, a new media architecture for efficient, high-performance playback of audio/video media, with optimized support for modern codecs. As an Objective-C API, QTKit provides a great deal of functionality in a relatively small package, with methods and classes that support a wide range of media-related tasks, such as playback, editing, and capture.
The goal of this programming guide is to show you how to take advantage of the QTKit classes and methods in your application, through code examples and step-by-step procedures that illustrate various coding techniques and best practices. In addition, the guide provides you with a class hierarchy and architectural overview of the framework itself, grouping some of the most frequently used playback and capture methods to accomplish particular tasks.
Who Should Read This Document
If you are a media developer who wants to integrate movies in your Cocoa application, you should read the material in this document. You don’t necessarily need to be a seasoned Cocoa programmer to take advantage of the capabilities provided in the QTKit framework, although you’ll need some prior experience working with Objective-C, Xcode, and Interface Builder to build and compile the code examples described in this guide. The document describes QTKit for OS X v10.6 and later.
A prerequisite for working with the QTKit framework is a basic understanding of Cocoa and the Objective-C programming language. The basics of Cocoa and Objective-C are discussed in detail in the Cocoa Fundamentals Guide and The Objective-C Programming Language guide. It may also be helpful to have an understanding of the OS X graphics and imaging technologies which are described in Mac Technology Overview. If you need to learn the basics of how to build and compile a media playback or recorder application, refer to the QTKit Application Tutorial. The tutorial is intended to get you rapidly up to speed with QTKit by working step by step through a set of code samples that let you accomplish playback and recording tasks.
Organization of This Document
This guide is organized into an overview chapter that discusses the fundamentals of the QTKit architecture, followed by a chapter describing the QTKit classes and methods designed for audio/video capture and recording. The last chapter deals with how to modify your existing QTKit code to take advantage of the improved playback performance and modern codec optimizations available in Mac OS v10.6 and the new media architecture of QuickTime X.
QTKit Architecture describes the QTKit software architecture, class hierarchy, design and object model, and various programming tasks you can perform, such as opening and playing movies. It also discusses thread-safety issues that you need to understand in order to work with the API.
QTKit Capture describes the portion of the QTKit API that deals with capture and recording of media and provides a set of use cases and code samples for dealing with various capture programming tasks.
Adopting QuickTime X for Playback discusses how your application can opt into the new, more efficient media playback capabilities available in QuickTime X and Mac OS v10.6.
For more information on the technologies and tools you use in this programming guide, consult the following Apple documentation:
QTKit Framework Reference contains the class and protocol reference documentation for the QTKit framework.
Interface Builder User Guide describes Interface Builder, Apple interface creation tool.
A Tour of Xcode provides an introduction on how to use the Xcode IDE.
QTKit Application Tutorial explains how to build three different Cocoa applications for playing, editing, and recording audio/video media, using QTKit.