AVAssetExportSession翻译

来源:互联网 发布:淘宝马克华菲折扣店 编辑:程序博客网 时间:2024/06/11 10:57

@class AVAssetExportSession

@abstract
一个AVAssetExportSession创建一个新的timed media resource, 这个resource来自一个已存在的被一个指定的输出预设描述的AVAsset的内容。

@discussion
1.在实例化一个AVAssetExportSession之前,你可以调用+allExportPresets来确保所有的预设值列表有效。调用+exportPresetsCompatibleWithAsset:来确保所有的预设值对一个特定的AVAsset是兼容的。

2.要配置一个export,用一个包含了source media, an AVAssetExportPreset, the output file type, (a UTI string from
those defined in AVMediaFormat.h) and the output URL的AVAsset来实例化一个AVAssetExportSession。

3.在配置完成之后,调用exportAsynchronouslyWithCompletionHandler: 来开始export process。这个方法立即返回,这个export是异步执行的。调用-progress方法来查看进度。注意在某些情况下,取决于设备的能力,当多个exports同时执行时,有些exports可能需要排队知道其他exports完成。当这种情况发生时,queued export的status将指示”waiting”。

4.当这个export fails, completes, or is cancelled,你提供的completion handler将被调用。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.