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