<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCompositionTrackSegment/init(url:trackID:sourceTimeRange:targetTimeRange:)-4rc2g",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCompositionTrackSegment(im)initWithURL:trackID:sourceTimeRange:targetTimeRange:"
  },
  "title" : "init(url:trackID:sourceTimeRange:targetTimeRange:)"
}
-->

# init(url:trackID:sourceTimeRange:targetTimeRange:)

Creates an object that presents a segment of a media file that the specified URL references.

```
init(url URL: URL, trackID: CMPersistentTrackID, sourceTimeRange: CMTimeRange, targetTimeRange: CMTimeRange)
```

## Parameters

`URL`

A URL of the source media file.

`trackID`

The identifier of the track whose media this segment presents.

`sourceTimeRange`

The time range of the track whose media this segment presents.

`targetTimeRange`

The time range of the composition track to present the segment’s media.

## 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)