<!--
{
  "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/AVMovie/writeHeader(to:fileType:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVMovie(im)writeMovieHeaderToURL:fileType:options:error:"
  },
  "title" : "writeHeader(to:fileType:options:)"
}
-->

# writeHeader(to:fileType:options:)

Writes the movie header to the specified URL.

```
func writeHeader(to URL: URL, fileType: AVFileType, options: AVMovieWritingOptions = []) throws
```

## Parameters

`URL`

The URL indicating where to write the movie header.

`fileType`

A UTI that indicates the specific file format for the movie header.

`options`

The [`AVMovieWritingOptions`](/documentation/AVFoundation/AVMovieWritingOptions) constants whose bits specify the options for writing the movie header.

## Discussion

---

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)