<!--
{
  "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/init(data:options:error:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVMutableMovie(im)initWithData:options:error:"
  },
  "title" : "init(data:options:error:)"
}
-->

# init(data:options:error:)

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

```
init(data: Data, options: [String : Any]? = nil, error: ()) throws
```

## Parameters

`data`

An `NSData` object that contains a movie header.

`options`

A dictionary that contains key for specifying the movie object initialization. Currently, no keys are defined.

## Return Value

An `AVMutableMovie` object.

## Discussion

On initialization, the [`defaultMediaDataStorage`](/documentation/AVFoundation/AVMutableMovie/defaultMediaDataStorage) property and any associated [`mediaDataStorage`](/documentation/AVFoundation/AVMutableMovieTrack/mediaDataStorage) properties are set to `nil`. To create an `AVMutableMovie` from a file and then append sample buffers to any of its tracks, you must first set one of these properties to indicate where the sample data should be written.

Use this method to create movies from movie headers that are not stored in files, which can include movies on the pasteboard.

---

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)