<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetVideoTrackPlan/init(videoCodecType:encoderSpecification:mediaType:segmentConfigurations:assemblyTrackID:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "s:So21AVAssetVideoTrackPlanC12AVFoundationE14videoCodecType20encoderSpecification05mediaH021segmentConfigurations08assemblyC2IDABSo07AVVideogH0a_SDySSs8Sendable_pGSgSo07AVMediaH0aSaySo09AVPlannedB20SegmentConfigurationCGs5Int32Vtcfc"
  },
  "title" : "init(videoCodecType:encoderSpecification:mediaType:segmentConfigurations:assemblyTrackID:)"
}
-->

# init(videoCodecType:encoderSpecification:mediaType:segmentConfigurations:assemblyTrackID:)

Creates an instance of AVAssetVideoTrackPlan.

```
convenience init(videoCodecType: AVVideoCodecType, encoderSpecification: [String : any Sendable]? = nil, mediaType: AVMediaType, segmentConfigurations: [AVPlannedVideoSegmentConfiguration], assemblyTrackID: CMPersistentTrackID)
```

## Parameters

`videoCodecType`

Video codec type of the track.

`encoderSpecification`

A dictionary describing the characteristics of a video encoder to use. Pass nil to let the system choose an encoder. If the client provides a specification, it should omit the following keys: kVTCompressionPropertyKey_SourceFrameCount, kVTCompressionPropertyKey_MoreFramesBeforeStart, and kVTCompressionPropertyKey_MoreFramesAfterEnd, since such keys will be overwritten by the underlying implementation.

`mediaType`

Media type of the track. Only AVMediaTypeVideo and AVMediaTypeAuxiliaryPicture are supported.

`segmentConfigurations`

Segment configurations of the track.

`assemblyTrackID`

The trackID that identifies this track in the assemblyComposition the planner passes to the completion handler of the incremental writing session.

## Discussion

This initializer throws NSInvalidArgumentException in the following cases:

1. mediaType is not supported. Supported media types are AVMediaTypeVideo and AVMediaTypeAuxiliaryPicture
2. The encoder specified by videoCodecType and encoderSpecification does not support video encoding in segments

---

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)