An object that transcodes the contents of an asset source object to create an output of the form described by a specified export preset.


@interface AVAssetExportSession : NSObject


Prior to initializing an instance of AVAssetExportSession, you can use allExportPresets to get the complete list of presets available. Use exportPresetsCompatibleWithAsset: to get a list of presets that are compatible with a specific asset.

After you have initialized an export session with the asset that contains the source media, the export preset name (presetName), and the output file type (outputFileType), you can start the export running by invoking exportAsynchronouslyWithCompletionHandler:. Because the export is performed asynchronously, this method returns immediately—you can use progress to check on the progress. Depending on the capabilities of the device, some exports may be queued when multiple exports are attempted. When this happens, the status of a queued export will indicate that it's waiting (AVAssetExportSessionStatusWaiting).

The completion handler you supply to exportAsynchronouslyWithCompletionHandler: is called whether the export fails, completes, or is cancelled. Upon completion, the status property indicates whether the export has completed successfully. If it has failed, the value of the error property supplies additional information about the reason for the failure.


Initializing a Session

- initWithAsset:presetName:

Creates an asset export session with a specified asset and preset.

+ exportSessionWithAsset:presetName:

Returns an asset export session configured with a specified asset and preset.

Configuring Output


The URL of the export session’s output.


An array containing the types of files the session can write.


The type of file written by the session.


The file length that the output of the session should not exceed.


The time range exported from the source.


The metadata written to the output file by the export session.


Specifies a filter object used during export to determine which metadata items to transfer from the source asset.


The parameters for audio mixing and an indication whether to enable nondefault audio mixing for export.


A processing algorithm used to manage audio pitch for scaled audio edits.


A Boolean value that indicates whether to optimize the movie should for network use.


The instructions for video composition, and indicates whether video composition is enabled for export.


The custom video compositor instance used, if any.


A Boolean value that indicates whether the export session can perform multiple passes over the source media to achieve better results.


A directory that is suitable for containing temporary files generated during the export process.

Configuring Export Presets


The name of the preset used to initialize the session.

+ allExportPresets

Returns all available export preset names.

+ exportPresetsCompatibleWithAsset:

Returns the identifiers compatible with a given asset.

+ determineCompatibilityOfExportPreset:withAsset:outputFileType:completionHandler:

Reports the compatibility of an export present, asset, and output file type to the specified block.

Export Preset Names for Device-Appropriate QuickTime Files

You use these export options to produce QuickTime movie files with video size appropriate to the current device.

Export Preset Names for QuickTime Files of a Given Size

You use these export options to produce QuickTime movie files with a specified video size.

Export Preset Name for iTunes Audio

You use this export option to produce an audio-only MPEG 4 Audio file with appropriate iTunes gapless playback data.

Export Preset Names for Apple Devices

You use these export options to produce playable files for use on specific Apple devices.

Export Preset Name for Pass Through

You use this export option to let all tracks pass through as formatted unless otherwise prohibited.

- determineCompatibleFileTypesWithCompletionHandler:

Reports the compatible file types for the current export session to the specified block.

Exporting Media

- exportAsynchronouslyWithCompletionHandler:

Starts the asynchronous execution of an export session.

- cancelExport

Cancels the execution of an export session.


Describes the error that occurred.


A set of statuses used for relaying the state of an export session.


The estimated size, in bytes, of the exported file.


Provides an estimate of the maximum duration of the exported media.

Getting Export Status


The progress of the export on a scale from 0 to 1.


The status of the export session.

Accessing the Asset


The asset used to initialize the export session.


Inherits From

See Also

File Export

Exporting Video to Alternative Formats

Convert an existing movie file to a different format.


An object used to write media data to a new file of a specified audiovisual container type.


A writer used to append media samples to a single track of an asset writer's output file.


The transfer function for the ITU_R BT.2100 color space.


An object that specifies a set of parameters for configuring objects that use output settings dictionaries.


A group of tracks in a mutually exclusive relationship.


An object that defines an interface for writing metadata packaged as timed metadata groups into a single asset writer input.


An object that defines an interface for querying about the requirements of the current pass.


A buffer used to append video samples packaged as pixel buffers to a single asset writer input.