<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetWriterInput/MediaDataLocation-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:@T@AVAssetWriterInputMediaDataLocation"
  },
  "title" : "AVAssetWriterInput.MediaDataLocation"
}
-->

# AVAssetWriterInput.MediaDataLocation

A structure that indicates how to lay out and interleave media data.

```
struct MediaDataLocation
```

## Topics

### Media data locations

[`static let interleavedWithMainMediaData: AVAssetWriterInput.MediaDataLocation`](/documentation/AVFoundation/AVAssetWriterInput/MediaDataLocation-swift.struct/interleavedWithMainMediaData)

A value that indicates to interleave the input’s media data with other media data.

[`static let beforeMainMediaDataNotInterleaved: AVAssetWriterInput.MediaDataLocation`](/documentation/AVFoundation/AVAssetWriterInput/MediaDataLocation-swift.struct/beforeMainMediaDataNotInterleaved)

A value that indicates to use noninterleaved data, and write it before interleaved data.

[`static let sparselyInterleavedWithMainMediaData: AVAssetWriterInput.MediaDataLocation`](/documentation/AVFoundation/AVAssetWriterInput/MediaDataLocation-swift.struct/sparselyInterleavedWithMainMediaData)

Indicates that there may be large segments of time without any media data from this track. When mediaDataLocation is set to this value, AVAssetWriter will interleave the media data, but will not wait for media data from this track to achieve tight interleaving with other tracks.

### Initializers

[`init(rawValue: String)`](/documentation/AVFoundation/AVAssetWriterInput/MediaDataLocation-swift.struct/init(rawValue:))

Creates a location with a string value.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

---

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)