Platforms to show: All Mac Windows Linux Cross-Platform

Back to AVAssetWriterInputPixelBufferAdaptorMBS class.

AVAssetWriterInputPixelBufferAdaptorMBS.appendPicture(pic as picture, presentationTime as CMTimeMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Appends a picture to the receiver.

Internally creates a copy of the picture to create a PixelBuffer and calls appendPixelBuffer.
Works in Cocoa and Carbon. Using appendPixelBuffer directly with PixelBuffer objects may be more efficient depending on what your app does.

Some examples using this method:

AVAssetWriterInputPixelBufferAdaptorMBS.appendPixelBuffer(pixelBuffer as CVPixelBufferMBS, presentationTime as CMTimeMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Appends a pixel buffer to the receiver.

pixelBuffer: The CVPixelBuffer to be appended.
presentationTime: The presentation time for the pixel buffer to be appended. This time will be considered relative to the time passed to AVAssetWriter.startSessionAtSourceTime to determine the timing of the frame in the output file.

Returns true if the pixel buffer was successfully appended, otherwise false.

If the operation was unsuccessful, you might invoke the AVAssetWriter object's finishWriting method in order to save a partially completed asset.
Do not modify a CVPixelBuffer or its contents after you have passed it to this method.

Some examples using this method:

AVAssetWriterInputPixelBufferAdaptorMBS.assetWriterInput as AVAssetWriterInputMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The asset writer input to which the adaptor should append pixel buffers. (read-only)

Some examples using this method:

AVAssetWriterInputPixelBufferAdaptorMBS.Constructor(input as AVAssetWriterInputMBS, sourcePixelBufferAttributes as dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a new pixel buffer adaptor to receive pixel buffers for writing to the output file.

input: The asset writer input to which the receiver should append pixel buffers.
Currently, only asset writer inputs that accept media data of type AVMediaTypeVideo can be used to initialize a pixel buffer adaptor.
It is an error to pass a sample buffer input that is already attached to another instance of AVAssetWriterInputPixelBufferAdaptor.

sourcePixelBufferAttributes: The attributes of pixel buffers that will be vended by the input's CVPixelBufferPool.
Pixel buffer attributes keys for the pixel buffer pool are defined in <CoreVideo/CVPixelBuffer.h>. To take advantage of the improved efficiency of appending buffers created from the adaptor's pixel buffer pool, you should specify pixel buffer attributes that most closely accommodate the source format of the video frames being appended.
Pass nil if you do not need a pixel buffer pool for allocating buffers.

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

To specify the pixel format type, the pixelBufferAttributes dictionary should contain a value for kCVPixelBufferPixelFormatTypeKey. For example, use kCVPixelFormatType_32BGRA as Integer for 8-bit-per-channel BGRA, or use kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange as Integer for 2-plane YCbCr.

AVAssetWriterInputPixelBufferAdaptorMBS.sourcePixelBufferAttributes as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The pixel buffer attributes of pixel buffers that will be vended by the adaptor's CVPixelBufferPool. (read-only)

The value of this property is a dictionary containing pixel buffer attributes keys defined in <CoreVideo/CVPixelBuffer.h>.

The items on this page are in the following plugins: MBS AVFoundation Plugin.


The biggest plugin in space...