You use an AVAssetWriterInputPixelBufferAdaptor to append video samples packaged as CVPixelBuffer objects to a single AVAssetWriterInput object.


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