<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVMutableMovie",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVMutableMovie"
  },
  "title" : "AVMutableMovie"
}
-->

# AVMutableMovie

A mutable object that represents an audiovisual container that conforms to the QuickTime movie file format or a related format like MPEG-4.

```
class AVMutableMovie
```

## Overview

This class is a mutable subclass of [`AVMovie`](/documentation/AVFoundation/AVMovie) that provides methods that support movie editing. For example, you can use a mutable movie to copy media data from one track and paste it into another. You can also use this object to create track references from one track to another (for example, to set one track as a chapter track of another track). To perform editing operations on individual tracks, use the associated classes [`AVMovieTrack`](/documentation/AVFoundation/AVMovieTrack) and [`AVMutableMovieTrack`](/documentation/AVFoundation/AVMutableMovieTrack).

You use movie objects only when operating on format-specific features of a QuickTime or ISO base media file. You typically don’t use these classes to open and play QuickTime movie files or ISO base media files. Instead, you use [`AVURLAsset`](/documentation/AVFoundation/AVURLAsset) and [`AVPlayerItem`](/documentation/AVFoundation/AVPlayerItem).

When performing media insertions, a movie interleaves media data from tracks in the source asset to optimize the movie file for playback. However, performing a series of media insertions may result in a movie file that’s not optimally interleaved. You can optimize a movie file for playback by exporting it with an [`AVAssetExportSession`](/documentation/AVFoundation/AVAssetExportSession) object using the export preset [`AVAssetExportPresetPassthrough`](/documentation/AVFoundation/AVAssetExportPresetPassthrough), and setting the [`shouldOptimizeForNetworkUse`](/documentation/AVFoundation/AVAssetExportSession/shouldOptimizeForNetworkUse) property value to <doc://com.apple.documentation/documentation/Swift/true>.

## Topics

### Creating a movie

[`movieWithURL:options:error:`](/documentation/AVFoundation/AVMutableMovie/movieWithURL:options:error:)

Returns a new mutable movie object from a movie header stored in a QuickTime movie file of ISO base media file.

[`init(url:options:error:)`](/documentation/AVFoundation/AVMutableMovie/init(url:options:error:)-8rnnj)

Creates a mutable movie object from a movie header stored in a QuickTime movie file of ISO base media file.

[`movieWithData:options:error:`](/documentation/AVFoundation/AVMutableMovie/movieWithData:options:error:)

Returns a new mutable movie object from a movie stored in a data object.

[`init(data:options:error:)`](/documentation/AVFoundation/AVMutableMovie/init(data:options:error:))

Creates a mutable movie object from a movie stored in a data object.

[`movieWithSettingsFromMovie:options:error:`](/documentation/AVFoundation/AVMutableMovie/movieWithSettingsFromMovie:options:error:)

Returns a new mutable movie object without tracks.

[`init(settingsFrom:options:)`](/documentation/AVFoundation/AVMutableMovie/init(settingsFrom:options:))

Creates a mutable movie object without tracks.

### Configuring a movie

[`isModified`](/documentation/AVFoundation/AVMutableMovie/isModified)

A Boolean value that indicates whether the movie is in a modified state.

[`timescale`](/documentation/AVFoundation/AVMutableMovie/timescale)

The time scale of the movie.

[`interleavingPeriod`](/documentation/AVFoundation/AVMutableMovie/interleavingPeriod)

A time period indicating the duration for interleaving runs of samples for each track.

[`defaultMediaDataStorage`](/documentation/AVFoundation/AVMutableMovie/defaultMediaDataStorage)

The default storage container for media data that you add to a movie.

### Loading tracks

[`tracks`](/documentation/AVFoundation/AVPartialAsyncProperty/tracks-2lj40)

The tracks that a movie contains.

[`loadTrack(withTrackID:completionHandler:)`](/documentation/AVFoundation/AVMutableMovie/loadTrack(withTrackID:completionHandler:))

Loads a track that contains the specified identifier.

[`loadTracks(withMediaType:completionHandler:)`](/documentation/AVFoundation/AVMutableMovie/loadTracks(withMediaType:completionHandler:))

Loads tracks that contain media of a specified type.

[`loadTracks(withMediaCharacteristic:completionHandler:)`](/documentation/AVFoundation/AVMutableMovie/loadTracks(withMediaCharacteristic:completionHandler:))

Loads tracks that contain media of a specified characteristic.

### Accessing tracks

Prefer loading tracks asynchronously using the methods in Loading Tracks.

[`tracks`](/documentation/AVFoundation/AVMutableMovie/tracks)

The tracks that a movie contains.

[`track(withTrackID:)`](/documentation/AVFoundation/AVMutableMovie/track(withTrackID:))

Retrieves a track in the movie that contains the specified identifier.

[`tracks(withMediaType:)`](/documentation/AVFoundation/AVMutableMovie/tracks(withMediaType:))

Retrieves tracks in the movie that present media of the specified type.

[`tracks(withMediaCharacteristic:)`](/documentation/AVFoundation/AVMutableMovie/tracks(withMediaCharacteristic:))

Retrieve tracks in the movie that present media of the specified characteristic.

[`unusedTrackID()`](/documentation/AVFoundation/AVMutableMovie/unusedTrackID())

Returns an identifier that no other tracks in the asset use.

### Accessing track groups

[`trackGroups`](/documentation/AVFoundation/AVMutableMovie/trackGroups)

The track groups an asset contains.

### Managing tracks

[`mutableTrack(compatibleWith:)`](/documentation/AVFoundation/AVMutableMovie/mutableTrack(compatibleWith:))

Provides a reference to a track from a mutable movie into which you can insert any time range.

[`addMutableTrack(withMediaType:copySettingsFrom:options:)`](/documentation/AVFoundation/AVMutableMovie/addMutableTrack(withMediaType:copySettingsFrom:options:))

Adds an empty track to the target movie.

[`addMutableTracksCopyingSettings(from:options:)`](/documentation/AVFoundation/AVMutableMovie/addMutableTracksCopyingSettings(from:options:))

Adds one or more empty tracks to the target movie and copies the track settings from the source tracks.

[`removeTrack(_:)`](/documentation/AVFoundation/AVMutableMovie/removeTrack(_:))

Removes the specified track from the target movie.

### Managing time ranges

[`insertEmptyTimeRange(_:)`](/documentation/AVFoundation/AVMutableMovie/insertEmptyTimeRange(_:))

Adds an empty time range to a movie.

[`insertTimeRange(_:of:at:copySampleData:)`](/documentation/AVFoundation/AVMutableMovie/insertTimeRange(_:of:at:copySampleData:))

Inserts all of the tracks in a specified time range of an asset into a movie.

[`scale(_:toDuration:)`](/documentation/AVFoundation/AVMutableMovie/scale(_:toDuration:))

Changes the duration of a time range in a movie.

[`removeTimeRange(_:)`](/documentation/AVFoundation/AVMutableMovie/removeTimeRange(_:))

Removes the specified time range from a movie.

### Accessing duration and timing

[`duration`](/documentation/AVFoundation/AVMutableMovie/duration)

A time value that indicates the asset’s duration.

[`providesPreciseDurationAndTiming`](/documentation/AVFoundation/AVMutableMovie/providesPreciseDurationAndTiming)

A Boolean value that indicates whether the asset provides precise duration and timing.

[`minimumTimeOffsetFromLive`](/documentation/AVFoundation/AVMutableMovie/minimumTimeOffsetFromLive)

A time value that indicates how closely playback follows the latest live stream content.

### Accessing metadata

[`metadata`](/documentation/AVFoundation/AVMutableMovie/metadata)

An array of metadata items for all metadata identifiers for which a value is available.

[`commonMetadata`](/documentation/AVFoundation/AVMutableMovie/commonMetadata)

The metadata items an asset contains for common metadata identifiers that provide a value.

[`availableMetadataFormats`](/documentation/AVFoundation/AVMutableMovie/availableMetadataFormats)

The metadata formats this asset contains.

[`metadata(forFormat:)`](/documentation/AVFoundation/AVMutableMovie/metadata(forFormat:))

Returns an array of metadata items from the container with the specified format.

[`creationDate`](/documentation/AVFoundation/AVMutableMovie/creationDate)

A metadata item that indicates the asset’s creation date.

[`lyrics`](/documentation/AVFoundation/AVMutableMovie/lyrics)

The lyrics of the asset in a language suitable for the current locale.

### Determining suitability

[`isPlayable`](/documentation/AVFoundation/AVMutableMovie/isPlayable)

A Boolean value that indicates whether the asset has playable content.

[`isReadable`](/documentation/AVFoundation/AVMutableMovie/isReadable)

A Boolean value that indicates whether you can extract the asset’s media data using an asset reader.

[`isExportable`](/documentation/AVFoundation/AVMutableMovie/isExportable)

A Boolean value that indicates whether you can export this asset using an export session.

[`isComposable`](/documentation/AVFoundation/AVMutableMovie/isComposable)

A Boolean value that indicates whether you can use the asset as a segment of a composition track.

[`isCompatibleWithAirPlayVideo`](/documentation/AVFoundation/AVMutableMovie/isCompatibleWithAirPlayVideo)

A Boolean value that indicates whether the asset is compatible with AirPlay Video.

[`isCompatibleWithSavedPhotosAlbum`](/documentation/AVFoundation/AVMutableMovie/isCompatibleWithSavedPhotosAlbum)

A Boolean value that indicates whether you can write the composition to the Saved Photos album.

### Inspecting preferences

[`preferredRate`](/documentation/AVFoundation/AVMutableMovie/preferredRate)

The asset’s rate preference for playing its media.

[`preferredVolume`](/documentation/AVFoundation/AVMutableMovie/preferredVolume)

The asset’s volume preference for playing its audible media.

[`preferredTransform`](/documentation/AVFoundation/AVMutableMovie/preferredTransform)

The asset’s transform preference to apply to its visual content during presentation or processing.

[`preferredMediaSelection`](/documentation/AVFoundation/AVMutableMovie/preferredMediaSelection)

The default media selections for this asset’s media selection groups.

### Accessing media selections

[`allMediaSelections`](/documentation/AVFoundation/AVMutableMovie/allMediaSelections)

The array of available media selections for this asset.

[`availableMediaCharacteristicsWithMediaSelectionOptions`](/documentation/AVFoundation/AVMutableMovie/availableMediaCharacteristicsWithMediaSelectionOptions)

An array of media characteristics for which a media selection option is available.

[`mediaSelectionGroup(forMediaCharacteristic:)`](/documentation/AVFoundation/AVMutableMovie/mediaSelectionGroup(forMediaCharacteristic:))

Returns a media selection group that contains one or more options with the specified media characteristic.

### Accessing chapter metadata

[`availableChapterLocales`](/documentation/AVFoundation/AVMutableMovie/availableChapterLocales)

The locales of the asset’s chapter metadata.

[`chapterMetadataGroups(bestMatchingPreferredLanguages:)`](/documentation/AVFoundation/AVMutableMovie/chapterMetadataGroups(bestMatchingPreferredLanguages:))

Returns an array of chapters with a locale that best matches the list of preferred languages.

[`chapterMetadataGroups(withTitleLocale:containingItemsWithCommonKeys:)`](/documentation/AVFoundation/AVMutableMovie/chapterMetadataGroups(withTitleLocale:containingItemsWithCommonKeys:))

Returns an array of chapters that contain the specified title locale and common keys.

### Determining content protections

[`hasProtectedContent`](/documentation/AVFoundation/AVMutableMovie/hasProtectedContent)

A Boolean value that indicates whether the asset contains protected content.

### Determining fragment support

[`canContainFragments`](/documentation/AVFoundation/AVMutableMovie/canContainFragments)

A Boolean value that indicates whether you can extend the asset by fragments.

[`containsFragments`](/documentation/AVFoundation/AVMutableMovie/containsFragments)

A Boolean value that indicates whether at least one movie fragment extends the asset.

[`overallDurationHint`](/documentation/AVFoundation/AVMutableMovie/overallDurationHint)

The total duration of fragments that currently exist, or may exist in the future.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)