---
title: "requestExportSession(forVideo:options:exportPreset:resultHandler:)"
framework: photos
role: symbol
role_heading: Instance Method
path: "photos/phimagemanager/requestexportsession(forvideo:options:exportpreset:resulthandler:)"
---

# requestExportSession(forVideo:options:exportPreset:resultHandler:)

Requests an export session for writing the video asset’s data to a file, to be loaded asynchronously.

## Declaration

```swift
func requestExportSession(forVideo asset: PHAsset, options: PHVideoRequestOptions?, exportPreset: String, resultHandler: @escaping (AVAssetExportSession?, [AnyHashable : Any]?) -> Void) -> PHImageRequestID
```

## Parameters

- `asset`: The video asset for which an export session is to be created.
- `options`: Options specifying how Photos should handle the request and notify your app of progress or errors. For details, see doc://com.apple.photokit/documentation/Photos/PHVideoRequestOptions.
- `exportPreset`: The export preset name for exporting the asset. For available presets, see doc://com.apple.documentation/documentation/AVFoundation/AVAssetExportSession.
- `resultHandler`: A block that Photos calls after loading the asset’s data and preparing the export session. The block takes the following parameters:

## Return Value

Return Value A numeric identifier for the request. If you need to cancel the request before it completes, pass this identifier to the cancelImageRequest(_:) method.

## Discussion

Discussion When you call this method, Photos downloads the video data (if necessary) and creates an export session. It then calls your resultHandler block to provide the requested video. For additional export options, use the requestAVAsset(forVideo:options:resultHandler:) method and then create AVAssetReader and AVAssetWriter objects to transcode and output the video asset’s data.

## See Also

### Requesting Video Objects

- [requestPlayerItem(forVideo:options:resultHandler:)](photos/phimagemanager/requestplayeritem(forvideo:options:resulthandler:).md)
- [requestAVAsset(forVideo:options:resultHandler:)](photos/phimagemanager/requestavasset(forvideo:options:resulthandler:).md)
