Type Method

assetWriterInputWithMediaType:outputSettings:

Returns a new writer input object initialized with the specified media type and output settings.

Declaration

+ (instancetype)assetWriterInputWithMediaType:(AVMediaType)mediaType outputSettings:(NSDictionary<NSString *,id> *)outputSettings;

Parameters

mediaType

The type of samples to be accepted by the input object. For a list of media types, see AVFoundation Constants.

outputSettings

The settings used for encoding the media appended to the output. Pass nil to specify that the appended samples should not be re-encoded.

Audio output settings keys are defined in AV Foundation Audio Settings Constants. Video output settings keys are defined in AVFoundation Constants. Video output settings with keys from <CoreVideo/CVPixelBuffer.h> are not currently supported.

Return Value

A new writer input object that can accept samples of the specified media type and write them to the output file.

Discussion

Each new input accepts data for a new track of the asset writer’s output file. You add an input to an asset writer using the AVAssetWriter method addInput:.

Passing nil for outputSettings instructs the input to pass through appended samples, doing no processing before they are written to the output file. This is useful if, for example, you are appending buffers that are already in a desirable compressed format.

See Also

Creating an Asset Writer Input Instance

+ assetWriterInputWithMediaType:outputSettings:sourceFormatHint:

Returns a new writer input object initialized with the specified media type, output settings, and source format hint.

- initWithMediaType:outputSettings:

Initialize a writer input object with the specified media type and output settings.

- initWithMediaType:outputSettings:sourceFormatHint:

Initialize a writer input object with the specified media type, output settings, and source hint.

Video Settings Dictionaries

Define output image and video formats by using the key and value constants.