Type Method

determineCompatibilityOfExportPreset:withAsset:outputFileType:completionHandler:

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

Declaration

+ (void)determineCompatibilityOfExportPreset:(NSString *)presetName withAsset:(AVAsset *)asset outputFileType:(AVFileType)outputFileType completionHandler:(void (^)(BOOL compatible))handler;

Parameters

presetName

The name of the preset template for the export operation.

For possible values, see Export Preset Names for Device-Appropriate QuickTime Files, Export Preset Names for QuickTime Files of a Given Size, AVAssetExportSessionStatusCancelled, Export Preset Name for iTunes Audio, and Export Preset Name for Pass-Through.

asset

The asset object that you are planning to export.

outputFileType

The UTI string corresponding to the file type. For example, to specify a QuickTime movie file format, you could specify the constant AVFileTypeQuickTimeMovie. For a list of constants specifying UTIs for standard file types, see AVFoundation Constants.

handler

The block to execute with the results. This method makes a copy of the specified block. This parameter must not be nil.

This block takes a single Boolean parameter and returns no result. The parameter contains the value YES if the combination of options is compatible or NO if they are not.

Discussion

Because not all export presets are compatible with all assets and file types, you can use this method to query the compatibility of specific combos before using them. To ensure that the export operation succeeds, you should not make any significant changes to the asset between the time of calling this method and performing the export operation.

This method performs its checks asynchronously on a secondary thread and returns immediately. The results are similarly reported to the specified block on a secondary thread.

See Also

Configuring Export Presets

presetName

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.

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.