Platforms to show: All Mac Windows Linux Cross-Platform

Back to AVMutableCompositionTrackMBS class.

AVMutableCompositionTrackMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The private constructor.

See also:

AVMutableCompositionTrackMBS.Constructor(other as AVCompositionTrackMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 15.1 ✅ Yes ❌ No ❌ No ✅ Yes All
The copy constructor to initialize with a mutable copy of the given object.

See also:

AVMutableCompositionTrackMBS.extendedLanguageTag as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The language tag associated with the track, as an RFC 4646 language tag.

If not set, the value is nil.
(Read and Write computed property)

AVMutableCompositionTrackMBS.insertEmptyTimeRange(timeRange as CMTimeRangeMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds or extends an empty time range within the receiver.

timeRange: The empty time range to be inserted.

If you insert an empty time range into the track, any media that was presented during that interval prior to the insertion will be presented instead immediately afterward.

The nature of the data inserted depends upon the media type of the track. For example, an empty time range in a sound track presents silence.

AVMutableCompositionTrackMBS.insertTimeRange(timeRange as CMTimeRangeMBS, AssetTrack as AVAssetTrackMBS, startTime as CMTimeMBS, byref error as NSErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Inserts a time range of a source track.

timeRange: The time range of the track to be inserted.
track: The source track to be inserted.
startTime: The time at which track is to be presented by the composition track.
error: If track is not inserted successfully, contains an NSError object that describes the problem.

Returns true if track was inserted successfully, otherwise false.

By default, the inserted track's time range is presented at its natural duration and rate. You can scale it to a different duration (so that it is presented at a different rate) using scaleTimeRange:toDuration:.

Insertion might fail if, for example, the asset that you try to insert is restricted by copy-protection.

AVMutableCompositionTrackMBS.insertTimeRanges(timeRanges() as CMTimeRangeMBS, tracks() as AVAssetTrackMBS, startTime as CMTimeMBS, byref error as NSErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Inserts time ranges of source tracks.

Requires Mac OS X 10.8.

Inserts the timeRanges of multiple source tracks into a track of a composition.
timeRanges: Specifies the timeRanges to be inserted.
tracks: Specifies the source tracks to be inserted. Only AVAssetTracks of AVURLAssets are supported.
startTime: Specifies the time at which the inserted tracks are to be presented by the composition track. You may pass kCMTimeInvalid for startTime to indicate that the timeRanges should be appended to the end of the track.
error: Describes failures that may be reported to the user, e.g. the asset that was selected for insertion in the composition is restricted by copy-protection.
Returns a boolean value indicating the success of the insertion.

This method is equivalent to (but more efficient than) calling insertTimeRange for each timeRange/track pair.
If this method returns an error, none of the time ranges will be inserted into the composition track.
To specify an empty time range, pass NSNull for the track and a time range of starting at kCMTimeInvalid with a duration of the desired empty edit.

AVMutableCompositionTrackMBS.languageCode as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The language associated with the track, as an ISO 639-2/T language code.

If not set, the value is nil.
(Read and Write computed property)

AVMutableCompositionTrackMBS.naturalTimeScale as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The timescale in which time values for the track can be operated upon without extraneous numerical conversion.

If not set, the value is the natural time scale of the first non-empty edit, or 600 if there are no non-empty edits.

Set the value to 0 to revert to the default behavior.
(Read and Write computed property)

AVMutableCompositionTrackMBS.preferredTransform as CGAffineTransformMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The preferred transformation of the visual media data for display purposes.

If not set, the value is CGAffineTransformIdentity.
(Read and Write computed property)

AVMutableCompositionTrackMBS.preferredVolume as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The preferred volume of the audible media data.

If not set, the value is 1.0.
(Read and Write computed property)

AVMutableCompositionTrackMBS.removeTimeRange(timeRange as CMTimeRangeMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Removes a specified time range from the receiver.

timeRange: The time range to be removed.

Removing a time range does not cause the track to be removed from the composition. Instead it removes or truncates track segments that intersect with the time range.

AVMutableCompositionTrackMBS.scaleTimeRange(timeRange as CMTimeRangeMBS, duration as CMTimeMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Changes the duration of a time range in the receiver.

timeRange: The time range of the track to be scaled.
duration: The new duration of timeRange.

Each track segment affected by the scaling operation will be presented at a rate equal to source.duration / target.duration of its resulting timeMapping.

AVMutableCompositionTrackMBS.setCompositionTrackSegments(segments() as AVCompositionTrackSegmentMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets the composition track's array of track segments.

The timeMapping.target.start of the first track segment must be kCMTimeZero, and the timeMapping.target.start of each subsequent track segment must equal CMTimeRangeGetEnd(<#previousTrackSegment#>.timeMapping.target). You can use validateTrackSegments to ensure that an array of track segments conforms to this rule.

AVMutableCompositionTrackMBS.validateTrackSegments(trackSegments() as AVCompositionTrackSegmentMBS, byref error as NSErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a Boolean value that indicates whether a given array of track segments conform to the timing rules for a composition track.

trackSegments: An array of AVCompositionTrackSegment objects.
error: If validation fails, on return contains an NSError object that describes the problem.

Returns true if the track segments in trackSegments conform to the timing rules for a composition track, otherwise false.

You can use this method to ensure that an array of track segments is suitable for setting as the value of the trackSegments property. The timeMapping.target.start of the first track segment must be kCMTimeZero, and the timeMapping.target.start of each subsequent track segment must equal CMTimeRangeGetEnd(<#previousTrackSegment#>.timeMapping.target).

If you want to modify the existing trackSegments array, you can create a mutable copy of it, modify the mutable array, and then validate the mutable array using this method.

The items on this page are in the following plugins: MBS AVFoundation Plugin.


The biggest plugin in space...