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


Instances of AVAssetWriterInputPixelBufferAdaptor provide a CVPixelBufferPool that you can use to allocate pixel buffers for writing to the output file. Using the provided pixel buffer pool for buffer allocation is typically more efficient than appending pixel buffers allocated using a separate pool.


Creating an Adaptor

init(assetWriterInput: AVAssetWriterInput, sourcePixelBufferAttributes: [String : Any]? = nil)

Initializes a new pixel buffer adaptor to receive pixel buffers for writing to the output file.

Adding a Pixel Buffer

func append(CVPixelBuffer, withPresentationTime: CMTime)

Appends a pixel buffer to the receiver.

Inspecting a Pixel Buffer Adaptor

var assetWriterInput: AVAssetWriterInput

The asset writer input to which the adaptor should append pixel buffers.

var pixelBufferPool: CVPixelBufferPool?

A pixel buffer pool that will vend and efficiently recycle CVPixelBuffer objects that can be appended to the receiver.

var sourcePixelBufferAttributes: [String : Any]?

The pixel buffer attributes of pixel buffers that will be vended by the adaptor’s CVPixelBufferPool.


Inherits From

Conforms To

See Also

File Export

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 the output file of an AVAssetWriter object.

class AVOutputSettingsAssistant

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

class AVAssetWriterInputGroup

A group of tracks in a mutually exclusive relationship.

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; for example, the time ranges of media data to append.

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.