Instance Method


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


- (void)respondToEachPassDescriptionOnQueue:(dispatch_queue_t)queue usingBlock:(dispatch_block_t)block;



The queue on which the block should be invoked.


The block the receiver should invoke whenever a new pass has begun.


A typical block passed to this method will perform the following steps:

  1. Query the value of the receiver's currentPassDescription property and reconfigure the source of media data, for example, the AVAssetReader instance, accordingly.

  2. Invoke requestMediaDataWhenReadyOnQueue:usingBlock: to begin appending data for the current pass.

When all media data has been appended for the current request, invoke markCurrentPassAsFinished to begin the process of determining whether an additional pass is warranted. If an additional pass is warranted, the block passed to this method will be invoked to begin the next pass. If no additional passes are needed, the block passed to this method will be invoked one final time so the client can invoke markAsFinished in response to the value of currentPassDescription becoming nil.

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


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


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

- markCurrentPassAsFinished

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


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


The boundary, in bytes, for aligning media chunks.


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