<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlannedVideoSegmentWritingRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPlannedVideoSegmentWritingRequest"
  },
  "title" : "AVPlannedVideoSegmentWritingRequest"
}
-->

# AVPlannedVideoSegmentWritingRequest

AVPlannedVideoSegmentWritingRequest encompasses a request from the AVAssetWritingPlanner to the client code to write one incremental video track segment with compression.

```
class AVPlannedVideoSegmentWritingRequest
```

## Overview

The client should respond to this request by writing the specified time range of data to a movie file at the specified segmentFileOutputURL, with start PTS zero. The client’s writing work may be completed asynchronously. If it completes successfully, it must call the `-finish` method on the request object. If writing the segment fails, it must call the `-finishWithError:` method on the request object.

## Topics

### Inspecting the request

[`frameCount`](/documentation/AVFoundation/AVPlannedVideoSegmentWritingRequest/frameCount)

The number of frames in this planned video segment. This is provided for convenience, and is the same value that was configured for the segment in AVPlannedVideoSegmentConfiguration.

### Creating resumable compression sessions

[`createResumableCompressionSession(width:height:codecType:encoderSpecification:sourceImageBufferAttributes:outputHandler:)`](/documentation/AVFoundation/AVPlannedVideoSegmentWritingRequest/createResumableCompressionSession(width:height:codecType:encoderSpecification:sourceImageBufferAttributes:outputHandler:))

Helper function to create a VTCompressionSession that restores the video encoder state persisted at the end of the previous segment.

[`-  createResumableCompressionSessionWithAllocator:width:height:codecType:encoderSpecification:sourceImageBufferAttributes:compressedDataAllocator:outputCallback:outputCallbackRefCon:returningError:`](/documentation/AVFoundation/AVPlannedVideoSegmentWritingRequest/createResumableCompressionSessionWithAllocator:width:height:codecType:encoderSpecification:sourceImageBufferAttributes:compressedDataAllocator:outputCallback:outputCallbackRefCon:returningError:)

Helper function to create a VTCompressionSession that restores the video encoder state persisted at the end of the previous segment.

### Creating resumable writer inputs

[`makeResumableWriterInput(for:outputSettings:sourceFormatHint:)`](/documentation/AVFoundation/AVPlannedVideoSegmentWritingRequest/makeResumableWriterInput(for:outputSettings:sourceFormatHint:))

Helper function that returns a minimally configured AVAssetWriterInput object for writing the current segment.

[`-  resumableAssetWriterInputWithMediaType:outputSettings:sourceFormatHint:returningError:`](/documentation/AVFoundation/AVPlannedVideoSegmentWritingRequest/resumableAssetWriterInputWithMediaType:outputSettings:sourceFormatHint:returningError:)

Helper function that returns a minimally configured AVAssetWriterInput object for writing the current segment. The final video encoder state from the previous segment will be restored before writing starts.

## Relationships

### Conforms To

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

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

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

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

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

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

### Inherits From

[`AVPlannedSegmentWritingRequest`](/documentation/AVFoundation/AVPlannedSegmentWritingRequest)

---

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)