iOS Developer Library

Developer

AVFoundation Framework Reference AVMutableVideoCompositionInstruction Class Reference

Options
Deployment Target:

On This Page
Language:

AVMutableVideoCompositionInstruction

Inherits From


Import Statement


Swift

import AVFoundation

Objective-C

@import AVFoundation;

Availability


Available in iOS 4.0 and later

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

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

  • Returns a new mutable video composition instruction.

    Declaration

    Objective-C

    + (AVMutableVideoCompositionInstruction *)videoCompositionInstruction

    Return Value

    A new mutable video composition instruction.

    Discussion

    Import Statement

    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.

    Declaration

    Swift

    var layerInstructions: [AnyObject]!

    Objective-C

    @property(nonatomic, 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.

    Declaration

    Swift

    var timeRange: CMTimeRange

    Objective-C

    @property(nonatomic, assign) CMTimeRange timeRange

    Discussion

    If the time range is invalid, the video compositor will ignore it.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later

  • Indicates whether post processing is required for the video composition instruction.

    Declaration

    Swift

    var enablePostProcessing: Bool

    Objective-C

    @property(nonatomic, assign) BOOL enablePostProcessing

    Discussion

    If no post processing is required for the whole duration of the video composition instruction, set this property to NOfalse to make the composition process more efficient.

    The value is YEStrue by default.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later