Contents

recommendedVideoSettings(forVideoCodecType:assetWriterOutputFileType:)

Returns a video settings dictionary appropriate for capturing video to a file with the specified codec and type.

Declaration

func recommendedVideoSettings(forVideoCodecType videoCodecType: AVVideoCodecType, assetWriterOutputFileType outputFileType: AVFileType) -> [String : Any]?

Parameters

  • videoCodecType:

    The video codec type to write.

  • outputFileType:

    The Uniform Type Identifier of the file type to write. See File Format UTIs for supported types.

Return Value

A fully populated dictionary of keys and values that are compatible with AVAssetWriter.

Discussion

This dictionary contains keys and values described in Video settings and is suitable for use when creating an AVAssetWriterInput with the init(mediaType:outputSettings:) initializer.

For QuickTime movie and ISO file types, the recommended video settings produce output comparable to that of AVCaptureMovieFileOutput.

Note that the dictionary of settings is dependent on the current configuration of the output’s AVCaptureSession and its inputs. The settings dictionary may change if the session’s configuration changes. As such, configure your session first, then query the recommended video settings.

See Also

Configuring video capture