iOS Developer Library

Developer

AVFoundation Framework Reference AVVideoCompositionCoreAnimationTool Class Reference

Options
Deployment Target:

On This Page
Language:

AVVideoCompositionCoreAnimationTool

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

Inheritance


  • NSObject
  • AVVideoCompositionCoreAnimationTool
  • NSObject
  • AVVideoCompositionCoreAnimationTool

Conforms To


Import Statement


import AVFoundation @import AVFoundation;

Availability


Available in iOS 4.0 and later.
  • Add a Core Animation layer to the video composition.

    Declaration

    Swift

    init!(additionalLayer layer: CALayer!, asTrackID trackID: CMPersistentTrackID) -> AVVideoCompositionCoreAnimationTool

    Objective-C

    + (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 Core 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.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

  • Composes the composited video frame with a Core Animation layer.

    Declaration

    Swift

    init!(postProcessingAsVideoLayer videoLayer: CALayer!, inLayer animationLayer: CALayer!) -> AVVideoCompositionCoreAnimationTool

    Objective-C

    + (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.

    The videoLayer should be in the animationLayer sublayer tree. The animationLayer should not come from, or be added to, another layer tree.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

  • Composes the composited video frames with the Core Animation layer.

    Declaration

    Swift

    init!(postProcessingAsVideoLayers videoLayers: [AnyObject]!, inLayer animationLayer: CALayer!) -> AVVideoCompositionCoreAnimationTool

    Objective-C

    + (AVVideoCompositionCoreAnimationTool *)videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayers:(NSArray *)videoLayers inLayer:(CALayer *)animationLayer

    Parameters

    videoLayers

    An array containing the video layers

    animationLayer

    The animation layer.

    Return Value

    A new AVVideoCompositionCoreAnimationTool instance with the composited video frames and the rendered animation layer.

    Discussion

    Duplicates the composited video frames in each videoLayer and renders animationLayer to produce the final frame. The videoLayers should be in animationLayer's sublayer tree.

    The animationLayer should not come from, or be added to, another layer tree.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.