Instance Method

markCurrentPassAsFinished

Instructs the receiver to analyze the appended media data and determine whether to improve the results by re-encoding certain segments.

Declaration

- (void)markCurrentPassAsFinished;

Discussion

When the value of canPerformMultiplePasses is YES, call this method after you have appended all of your media data. After the receiver analyzes whether an additional pass is warranted, the value of currentPassDescription will change (usually asynchronously) to describe how to set up for the next pass. Although it is possible to use Key-value observing to determine when the value of currentPassDescription has changed, it is typically more convenient to invoke respondToEachPassDescriptionOnQueue:usingBlock: in order to start the work for each pass.

After re-appending the media data for all of the time ranges of the new pass, call this method again to determine whether additional segments should be re-appended in another pass.

Calling this method effectively cancels any previous invocation of requestMediaDataWhenReadyOnQueue:usingBlock:, meaning that requestMediaDataWhenReadyOnQueue:usingBlock: can be invoked again for each new pass. The respondToEachPassDescriptionOnQueue:usingBlock: method provides a convenient way to consolidate these invocations in your code.

After each pass, you have the option of keeping the most recent results by calling markAsFinished instead of this method. If the value of currentPassDescription is nil at the beginning of a pass, call markAsFinished to tell the receiver to not expect any further media data.

If the value of canPerformMultiplePasses is NO, the value of currentPassDescription will immediately become nil after calling this method.

Before calling this method, you must ensure that the receiver is attached to an AVAssetWriter instance via a prior call to addInput: and that startWriting has been called on the asset writer.

See Also

Performing Multiple-Pass Encoding

canPerformMultiplePasses

A Boolean value that indicates whether the input might perform multiple passes over appended media data.

currentPassDescription

An object that describes the requirements, such as source time ranges to append or re-append, to the current pass.

performsMultiPassEncodingIfSupported

A Boolean value that indicates whether the input should attempt to encode the source media data using multiple passes.

preferredMediaChunkAlignment

The boundary, in bytes, for aligning media chunks.

preferredMediaChunkDuration

The duration used for each chunk of sample data in the output file.

- respondToEachPassDescriptionOnQueue:usingBlock:

Instructs the receiver to invoke a client-supplied block whenever a new pass has begun.