AVVideoCompositionCoreAnimationTool Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in OS X v10.7 and later.
Declared in
AVVideoComposition.h
Related sample code

Overview

You use an AVVideoCompositionCoreAnimationTool object to incorporate Core Animation in a video composition.

Any animations will be interpreted on the video's timeline, not real-time, so you should:

  1. Set animations’ beginTime property to 1e-100 rather than 0 (which CoreAnimation replaces with CACurrentMediaTime);

  2. Set animations’ removedOnCompletion property to NO so they are not automatically removed.

Tasks

Creating a Composition Tool

Class Methods

videoCompositionCoreAnimationToolWithAdditionalLayer:asTrackID:

Add a Core Animation layer to the video composition.

+ (AVVideoCompositionCoreAnimationTool *)videoCompositionCoreAnimationToolWithAdditionalLayer:(CALayer *)layer asTrackID:(CMPersistentTrackID)trackID
Parameters
layer

The Core Animation layer to add.

trackID

A track ID to identify the track.

trackID should not match any real trackID in the source.

Return Value

A new animation tool for the layer.

Discussion

You use this method to include a Core Animation layer as an individual track input in video composition.

Video composition instructions should reference trackID where the rendered animation should be included.

Availability
  • Available in OS X v10.7 and later.
Declared In
AVVideoComposition.h

videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer:inLayer:

Composes the composited video frames with a Core Animation layer.

+ (AVVideoCompositionCoreAnimationTool *)videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer:(CALayer *)videoLayer inLayer:(CALayer *)animationLayer
Parameters
videoLayer

A video layer.

animationLayer

An animation layer.

Return Value

A new animation tool for the composition.

Discussion

Place composited video frames in videoLayer and render animationLayer to produce the final frame.

Availability
  • Available in OS X v10.7 and later.
Related Sample Code
Declared In
AVVideoComposition.h

Did this document help you? Yes It's good, but... Not helpful...