---
title: "init(data:options:error:)"
framework: avfoundation
role: symbol
role_heading: Initializer
path: "avfoundation/avmutablemovie/init(data:options:error:)"
---

# init(data:options:error:)

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

## Declaration

```swift
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

Return Value An AVMutableMovie object.

## Discussion

Discussion On initialization, the defaultMediaDataStorage property and any associated 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.

## See Also

### Creating a movie

- [init(url:options:error:)](avfoundation/avmutablemovie/init(url:options:error:)-8rnnj.md)
- [init(settingsFrom:options:)](avfoundation/avmutablemovie/init(settingsfrom:options:).md)
