iOS Developer Library


AV Foundation Framework Reference AVAssetWriterInputGroup Class Reference

Deployment Target:

On This Page


The AVAssetWriterInputGroup class associates tracks corresponding to inputs with each other in a mutually exclusive relationship.

This class is used to associate tracks corresponding to multiple AVAssetWriterInput instances as mutually exclusive to each other for playback or other processing.

For example, if you are creating an asset with multiple audio tracks using different spoken languages–and only one track should be played at a time–group the inputs corresponding to those tracks into a single instance of AVAssetWriterInputGroup and add the group to the AVAssetWriter instance using the AVAssetWriter method addInputGroup:. If the output format supports mutually exclusive relationships among tracks, the AVAssetWriter marks the tracks as mutually exclusive to each other.

Because the AVAssetWriterInputGroup class is a subclass of the AVMediaSelectionGroup class, clients can examine the media selection options that are available on the output asset before the asset is written. The best results for examining the options of the AVAssetWriterInputGroup are obtained after associating the AVAssetWriterInput instances of the AVAssetTrack objects as appropriate using the AVAssetWriterInput method addTrackAssociationWithTrackOfInput:type: and by initializing each AVAssetWriterInput with a source format hint, where appropriate.