iOS Developer Library

Developer

AVFoundation Framework Reference AVAssetWriterInputGroup Class Reference

Options
Deployment Target:

On This Page
Language:

AVAssetWriterInputGroup

Inherits From


Conforms To


Import Statement


Swift

import AVFoundation

Objective-C

@import AVFoundation;

Availability


Available in iOS 7.0 and later

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.