iOS Developer Library

Developer

AVFoundation Framework Reference AVVideoCompositionInstruction Class Reference

Options
Deployment Target:

On This Page
Language:

AVVideoCompositionInstruction

An AVVideoCompositionInstruction object represents an operation to be performed by a compositor.

An AVVideoComposition object maintains an array of instructions to perform its composition.

Inheritance


Import Statement


Swift

import AVFoundation

Objective-C

@import AVFoundation;

Availability


Available in iOS 4.0 and later.
  • The background color of the composition.

    Declaration

    Swift

    var backgroundColor: CGColor!

    Objective-C

    @property(nonatomic, retain) CGColorRef backgroundColor

    Discussion

    Only solid BGRA colors are supported; patterns and other supported colors are ignored. If the rendered pixel buffer does not have alpha, the alpha value of the background color is ignored.

    If the background color is NULL, the video compositor uses a default background color of opaque black.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

  • An array of instances of AVVideoCompositionLayerInstruction that specify how video frames from source tracks should be layered and composed. (read-only)

    Declaration

    Swift

    var layerInstructions: [AnyObject]! { get }

    Objective-C

    @property(nonatomic, readonly, copy) NSArray *layerInstructions

    Discussion

    Tracks are layered in the composition according to the top-to-bottom order of the layerInstructions array; the track with trackID of the first instruction in the array will be layered on top, with the track with the trackID of the second instruction immediately underneath, and so on.

    If the property value is nil, the output is a fill of the background color.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

    See Also

    backgroundColor

  • timeRange timeRange Property

    The time range during which the instruction is effective. (read-only)

    Declaration

    Swift

    var timeRange: CMTimeRange { get }

    Objective-C

    @property(nonatomic, readonly) CMTimeRange timeRange

    Discussion

    If the time range is invalid, the video compositor will ignore it. See also the requirements of the timeRange property in the array of objects implementing the AVVideoCompositionInstruction protocol as described in the AVVideoComposition class’s instructions property.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

  • A Boolean value that indicates whether post processing is required for the video composition instruction. (read-only)

    Declaration

    Swift

    var enablePostProcessing: Bool { get }

    Objective-C

    @property(nonatomic, readonly) BOOL enablePostProcessing

    Discussion

    A value of NOfalse indicates that no post processing is required for the whole duration of the video composition instruction. The composition process is more efficient if the value is NOfalse.

    The value is YEStrue by default.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

    See Also

    enablePostProcessing (AVVideoMutableCompositionInstruction)
    + videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer:inLayer: (AVVideoCompositionCoreAnimationTool)