Contents

performsMultiPassEncodingIfSupported

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

Declaration

var performsMultiPassEncodingIfSupported: Bool { get set }

Discussion

An asset writer input may be able to achieve higher quality and lower data rate by performing multiple passes over the source media. It does this by analyzing the media data it appends and reencodes certain segments with different parameters. To perform the reencoding, you must append the media data for the segments again. See the currentPassDescription property and markCurrentPassAsFinished() method for the means by which the input nominates segments to reappend.

When the value of this property is true, the value of isReadyForMoreMediaData for other inputs attached to the same asset writer may be false more often and for longer periods of time. In particular, the value of isReadyForMoreMediaData for inputs that don’t perform multiple passes may start as false after calling the method asset writer’s startWriting() method, and may not change to true until after all multipass inputs complete their final pass.

When the value of this property is true, the input may store data in one or more temporary files before writing compressed samples to the output file. Use the asset writer’s directoryForTemporaryFiles property if you need to specify the location of temporary file writing.

The default value is false, which means that no additional analysis occurs and it doesn’t reencode segments. Not all asset writer input configurations benefit from performing multiple passes over the source media. To determine whether the selected encoder can perform multiple passes, query the value of canPerformMultiplePasses after calling startWriting().

See Also

Performing multiple-pass encoding