A group of tracks in a mutually exclusive relationship.


class AVAssetWriterInputGroup : AVMediaSelectionGroup


Use this class 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 add(_:). If the output format supports mutually exclusive relationships among tracks, the AVAssetWriter marks the tracks as mutually exclusive to each other.

Because AVAssetWriterInputGroup is a subclass of AVMediaSelectionGroup, clients can examine the media selection options that are available on the output asset before writing the asset. Obtain the best results by examining the options of the AVAssetWriterInputGroup after associating the AVAssetWriterInput instances of the AVAssetTrack objects as appropriate using the AVAssetWriterInput method addTrackAssociation(withTrackOf:type:) and by initializing each AVAssetWriterInput with a source format hint, where appropriate.


Creating an Asset Writer Input Group

init(inputs: [AVAssetWriterInput], defaultInput: AVAssetWriterInput?)

Creates an instance of an asset writer input group.

Getting the Asset Writer Input Group Settings

var defaultInput: AVAssetWriterInput?

The default input of the receiver.

var inputs: [AVAssetWriterInput]

An array of inputs from which the asset writer receives media data.


Conforms To

See Also

File Export

Exporting Video to Alternative Formats

Convert an existing movie file to a different format.

class AVAssetExportSession

An object that transcodes the contents of an asset source object to create an output of the form described by a specified export preset.

class AVAssetWriter

An object used to write media data to a new file of a specified audiovisual container type.

class AVAssetWriterInput

A writer used to append media samples to a single track of an asset writer's output file.

let AVVideoTransferFunction_ITU_R_2100_HLG: String

The transfer function for the ITU_R BT.2100 color space.

class AVOutputSettingsAssistant

An object that specifies a set of parameters for configuring objects that use output settings dictionaries.

class AVAssetWriterInputMetadataAdaptor

An object that defines an interface for writing metadata packaged as timed metadata groups into a single asset writer input.

class AVAssetWriterInputPassDescription

An object that defines an interface for querying about the requirements of the current pass.

class AVAssetWriterInputPixelBufferAdaptor

A buffer used to append video samples packaged as pixel buffers to a single asset writer input.