AVMutableComposition
An object that you use to create a new composition from existing assets.
Declaration
class AVMutableCompositionOverview
Use this object to add and remove composition tracks, and add, remove, and scale their time ranges. You can make an immutable snapshot of a mutable composition for playback and inspection as follows:
// Use a mutable composition object you create.
let mutableComposition = AVMutableComposition()
guard let composition = mutableComposition.copy() as? AVComposition else { return }
// Create a player item to inspect and play the composition.
let playerItem = AVPlayerItem(asset: composition)Topics
Creating a composition
Loading tracks
tracksloadTrack(withTrackID:completionHandler:)loadTracks(withMediaType:completionHandler:)loadTracks(withMediaCharacteristic:completionHandler:)
Accessing tracks
Managing composition tracks
Managing Cinematic tracks
Managing time ranges
removeTimeRange(_:)scaleTimeRange(_:toDuration:)insertEmptyTimeRange(_:)insertTimeRange(_:of:at:completionHandler:)insertTimeRange(_:of:at:)