AVMutableVideoCompositionLayerInstruction Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in iOS 4.0 and later.
Declared in
AVVideoComposition.h
Related sample code

Overview

AVMutableVideoCompositionLayerInstruction is a mutable subclass of AVVideoCompositionLayerInstruction that you use to modify the transform and opacity ramps to apply to a given track in an AV composition.

Tasks

Creating an Instruction

Track ID

Managing Properties

Properties

trackID

The trackID of the source track to which the compositor will apply the instruction.

@property(nonatomic, assign) CMPersistentTrackID trackID
Discussion

Availability
  • Available in iOS 4.0 and later.
Declared In
AVVideoComposition.h

Class Methods

videoCompositionLayerInstruction

Returns a new mutable video composition layer instruction.

+ (AVMutableVideoCompositionLayerInstruction *)videoCompositionLayerInstruction
Return Value

A new mutable video composition layer instruction with no transform or opacity ramps and trackID initialized to kCMPersistentTrackID_Invalid.

Availability
  • Available in iOS 4.0 and later.
Declared In
AVVideoComposition.h

videoCompositionLayerInstructionWithAssetTrack:

Returns a new mutable video composition layer instruction for the given track.

+ (AVMutableVideoCompositionLayerInstruction *)videoCompositionLayerInstructionWithAssetTrack:(AVAssetTrack *)track
Parameters
track

The asset track to which to apply the instruction.

Return Value

A new mutable video composition layer instruction with no transform or opacity ramps and trackID initialized to the track ID of track.

Discussion

Availability
  • Available in iOS 4.0 and later.
Related Sample Code
Declared In
AVVideoComposition.h

Instance Methods

setOpacity:atTime:

Sets a value of the opacity at a time within the time range of the instruction.

- (void)setOpacity:(float)opacity atTime:(CMTime)time
Parameters
opacity

The opacity to be applied at time. The value must be between 0.0 and 1.0.

time

A time value within the time range of the composition instruction.

Discussion

Sets a fixed opacity to apply from the specified time until the next time at which an opacity is set; this is the same as setting a flat ramp for that time range. Before the first time for which an opacity is set, the opacity is held constant at 1.0; after the last specified time, the opacity is held constant at the last value.

Availability
  • Available in iOS 4.0 and later.
Declared In
AVVideoComposition.h

setOpacityRampFromStartOpacity:toEndOpacity:timeRange:

Sets an opacity ramp to apply during a specified time range.

- (void)setOpacityRampFromStartOpacity:(float)startOpacity toEndOpacity:(float)endOpacity timeRange:(CMTimeRange)timeRange
Parameters
startOpacity

The opacity to be applied at the start time of timeRange. The value must be between 0.0 and 1.0.

endOpacity

The opacity to be applied at the end time of timeRange. The value must be between 0.0 and 1.0.

timeRange

The time range over which the value of the opacity will be interpolated between startOpacity and endOpacity.

Discussion

During an opacity ramp, opacity is computed using a linear interpolation. Before the first time for which an opacity is set, the opacity is held constant at 1.0; after the last specified time, the opacity is held constant at the last value.

Availability
  • Available in iOS 4.0 and later.
Declared In
AVVideoComposition.h

setTransform:atTime:

Sets a value of the transform at a time within the time range of the instruction.

- (void)setTransform:(CGAffineTransform)transform atTime:(CMTime)time
Parameters
transform

The transform to be applied at time.

time

A time value within the time range of the composition instruction.

Discussion

Sets a fixed transform to apply from the specified time until the next time at which a transform is set. This is the same as setting a flat ramp for that time range. Before the first specified time for which a transform is set, the affine transform is held constant at the value of CGAffineTransformIdentity; after the last time for which a transform is set, the affine transform is held constant at that last value.

Availability
  • Available in iOS 4.0 and later.
Related Sample Code
Declared In
AVVideoComposition.h

setTransformRampFromStartTransform:toEndTransform:timeRange:

Sets a transform ramp to apply during a given time range.

- (void)setTransformRampFromStartTransform:(CGAffineTransform)startTransform toEndTransform:(CGAffineTransform)endTransform timeRange:(CMTimeRange)timeRange
Parameters
startTransform

The transform to be applied at the starting time of timeRange.

endTransform

The transform to be applied at the end time of timeRange.

timeRange

The time range over which the value of the transform will be interpolated between startTransform and endTransform.

Discussion

During a transform ramp, the affine transform is interpolated between the values set at the ramp's start time and end time. Before the first specified time for which a transform is set, the affine transform is held constant at the value of CGAffineTransformIdentity; after the last time for which a transform is set, the affine transform is held constant at that last value.

Availability
  • Available in iOS 4.0 and later.
Declared In
AVVideoComposition.h

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